ReadString
This function reads a null-terminated string from a stream.
Syntax
- string ReadString(number maxlength=0)
Parameters
- maxlength: the maximum length of the string to read.
Returns
Returns a string read from the stream.
Example
local path = "MyFile.dat"
local stream = FileSystem:WriteFile(path)
if (stream==nil) then Debug:Error("Failed to write file.") end
stream:WriteString("Hello!")
stream:Seek(0)
System:Print(stream:ReadString())
return false -- -- set a breakpoint here and view the printed output