TCP/IP 通信示例
Global String ReadData_P_All$, ReadData_P$(10), data$ '
Global Preserve Double x
Global Integer foundnumber_PFunction TCPServerSetNet #201, "192.168.0.1", 4000, CRLF, NONE, 0OpenNet #201 As ClientWaitNet #201Print "TCP Connected"Integer iDoIf ChkNet(201) > 0 ThenLine Input #201, ReadData_P_All$Print "ReadData-p:", ReadData_P_All$ParseStr ReadData_P_All$, ReadData_P$(), ","foundnumber_P = UBound(ReadData_P$())Print "foundnumber_P=", foundnumber_P, "RP", Len(ReadData_P_All$)If ReadData_P$(UBound(ReadData_P$())) = "#" ThenFor i = 0 To UBound(ReadData_P$())ReadData_P$(i) = ""Next iEndIfEndIfIf data$ <> "" ThenPrint #201, data$data$ = ""EndIfLoop
Fend