System::ReadFile
System::ReadFile will read in the contents of a file previously opened by System::CreateFile.
public System::ReadFile( OSHandle FileHandle, Integer Length = TVariable::None, Integer Position = TVariable::None : BString FileContents );
Parameters
FileHandle | From previous call to System::CreateFile. |
Length | will read the entire file to end if default parameter is passed. |
Position | will read from the current file position if default parameter is passed. |
FileContents | a buffer containing the contents of the file successfully read. |
Return Values
The error.errorCode value will be set to the underlining windows error message code and the error.errorString will have a detailed description of the error.
Remarks
Example Use
- TScript
main(){ variable fileHandle, fileBuffer; System::CreateFile(u"MyFile.txt", System::OPEN_EXISTING|System::READ_ONLY:fileHandle); System::ReadFile(fileHandle:fileBuffer); System::MessageBox(fileBuffer.ToString(), u"File Contents of MyFile.txt"); }
Since
TScript Version 1.0
Also See
System::CreateFile, System::SetFilePointer, System::WriteFileListen All
Comments (0)