ReadFile

Top  Previous  Next

 

ReadFile

 

Syntax

ReadFile([in] FileID, [in] StringLengthToRead, [out] StringReadVar);

 

Description

To read a string from an opened file. The file must have been opened with OpenFile using access right "r".

 

Parameters

       FileID

               The file index to read.

       StringLengthToRead

               The length of the string to read                

       StringReadVar

               The variable name to receive the read string

 

Return

       1 = success

       0 = failed

       -1 = FSCommands cannot be found

 

Example

 

FSCommand("ReadFile", "0,10,MessageVar");

 

This will read a string 10 characters length from previously opened file at index 1, into a variable _root.MessageVar