Synopsis:
sys_fhgetline(file_handle,pVar)
Arguments:
file_handle - The file handle to read from
pVar - Pointer to the variable that will hold the returned string
Description: This function is used to read strings from ASCII text files. It will read the string from the current file position up to the end of the current line (i.e until a carriage-return/line-feed is encountered) and write that string to the variable pointed to by pVar. Carriage-return and Line-feed characters are not included in the returned string.
An empty will be returned if the line only contains a carriage-return/line-feed.
Return Value:
The function returns 0 on success or a negative error code.
The following example opens a text file and writes each line of the file to the application log terminal.
int file_handle;
var str:255;
file_handle=sys_fhopen("textfile.txt","rs");
while(!sys_fheof(file_handle))
// Read the next line from the file..
sys_fhgetline(file_handle,&str);
// write line to the application log and terrminal console
applog(str);
endwhile