LassoScript Utility
Basics Browse Detail


Tag Link [File->ReadString] Category File
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


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

The tag requires a single parameter which specifies how many bytes of data to read from the file. In files that contain multi-byte data this number may not correspond to the number of characters which will be read from the file.


[Var: 'myFile' = (File: 'myfile.txt')]
[$myFile->(SetEncoding: 'iso-8859-1')]
[$myFile->(Write: 'Data')]
[$myFile->(ReadString: 32768)]


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


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