TSBasic_File
What: class
Ancestor: TCommon_COM_Interface
File: _COMLists
Layer: 0
Platforms: C++, C#, Pascal (All), PHP, Python
This class provides a minimal basic file interface suitable for level 0 of the subroutine
library, where the more full-featured file objects are unavailable. It has the following methods:
Close()
void Close()
procedure Close()
Closes the open file.
EOF
bool EOF()
function EOF() : boolean
Returns true if the current file position is at the end of the file. Returns false
otherwise. Note: in Python, this always returns False.
FileName
string FileName()
function FileName : string
Returns the name of the file that was opened.
Open
int Open( const string Name, int Flags )
function Open( const Name : string ; Flags : integer ) : integer
Opens the specified file. Flags indicate how the file is opened.
Value | Description |
---|---|
FOF_Read_Write | Open for reading and writing |
FOF_Read_Only | Open for reading only (supercedes FOF_Read_Write) |
FOF_Append | Open and position at end of file |
FOF_Must_Exist | File must exist |
FOF_Create | Create new file/overwrite old file |
Value | Meaning |
---|---|
FErr_Not_Found | File does not exist. |
ReadLn
string ReadLn()
function ReadLn() : string
Returns the next line from the file.
WriteLn
void WriteLn( const string Value )
procedure WriteLn( const Value : string )
Writes the specified text to the file.