FileRead

 

The 'FileRead' function reads the size specified in the file and puts it in the buf.

 

WORD FileRead(DWORD handle, string buf, WORD size);

 

Note : Only if a file is opened, you can read data from the file. In other words, only if you use the 'FileOpen' function, you can use the 'FlieRead' function to read data from the file. Also, after you finish your use of the file, you must always close the file. In other words, after you use the 'FileOpen' function, you must always use the 'FileClose' function.

 

Parameters

DWORD handle : 'Return Value' of the 'FileOpen' function

string buf : buffer in where the data is stored

WORD size : data size

 

Return Value

data size that was read

 

Example

handle = @FileOpen("C:\\EX.TXT", "r");

if(handle != 0)

{

@FileRead(handle, buf, 12);

@FileClose(handle);

}

Description : The first line is to open the file named 'EX.TXT' in C drive. If the file is opened, twelve data of the file is stored in the variable named 'buf'. Afterward, the file is closed by the '@FileClose(handle);'.