QB64.com

QB64 is a modern extended BASIC programming language that retains QBasic/QuickBASIC 4.5 compatibility and compiles native binaries for Windows, Linux, and macOS.

The PUT # TCP/IP statement sends unformatted(raw) data to an open connection using a user’s handle.

Syntax

*PUT *#handle, , data **

Parameters

Communicating using unformatted/raw streamed data:

Your program MUST cater for these situations manually.


*Example: string variable b$'s length is adjusted to the number of bytes read.*

 PUT #client, , a$ 'sends data (this could be a string, variable array, user defined type, etc)
 GET #openconn, , b$ 'reads any available data into variable length string b$ 
 GET #openconn, , x% 'reads 2 bytes of data as an integer value.

Explanation: Checking EOF(o) is unnecessary. If 2 bytes are available, they are read into x%, if not then nothing is read and EOF(o) will return -1

See the example in _OPENCLIENT

See Also