Shiny Language Reference
Language Reference > File Functions
freadbytes
bool freadbytes(file FileVar, string Dest, int Bytes);
Reads N bytes from a file
Parameters
FileVar
A variable declared as type FILE which has previously been associated with a file by using FOPEN.
Dest
A string variable that receives the line of text read from the file.
Bytes
An integer specifying the number of bytes to read from the file.
Return Value
TRUE if reading from the file suceeded and there is further data left in the file. Testing for FALSE is used to determine if the end of the file has been reached.
Example Code
file myfile;
if(fopen(myfile, "C:\\Readme.txt") == FALSE)
{
 bool bMoreData = TRUE;
 
 while(bMoreData)
 {
   // DataIn receives text from the file, 4 bytes at a time
   string DataIn;
   bMoreData = freadbytes(myfile, DataIn, 4);
 }
}