LassoScript Utility
Basics Browse Detail


Tag Link [Net->ReadString] Category Networking
Type Member Source Available Yes
Support Preferred Version 8.5
Change New Data Source Any
Output Type String Security None
Implementation Sets Lasso 8.5


[Net->ReadString] reads string data from a network connection. If a character set has been set using [Net->SetEncoding] then that character set is used to translate data from the network into Lasso's string format. Alternately, [Net->Read] can be used to read a byte stream from the network.

The tag requires a single parameter which specifies how many bytes of data to read from the network. If the connection is returning multi-byte data this number may not correspond to the number of characters which will be read.


[Var: 'myConnection' = (Net: '', 80)]
[$myConnection->(SetEncoding: 'iso-8859-1')]
[$myConnection->(Write: 'GET / HTTP/1.0\r\n')]
[$myConnection->(Write: '\r\n')]
[$myConnection->(ReadString: 32768)]


Optional Parameters
Length The maximum length in bytes of data to read from the network connection.


See the Lasso 8 Language Guide for examples of how to use this tag.