| GetText |
|
|
|
|
long GetText( LPSTR TextBuffer, // buffer that receives data long NumberOfCharacters = -1, // number of characters to read long FilePosition = -1, // position of data in file long Format = 0 // text format );
long GetText( LPWSTR TextBuffer, // buffer that receives data long NumberOfCharacters = -1, // number of characters to read long FilePosition = -1, // position of data in file long Format = 0 // text format );
GetText( TextBuffer As Variant, // variant that receives data NumberOfCharacters As Long = -1, // number of characters to read FilePosition As Long = -1, // position of data in file Format As TextFormat = 0 // text format ) As Long
| IXF_TEXT_NULLTERM | text is NULL terminated, |
| IXF_TEXT_CRLFTERM | text is CR/LF terminated, |
| IXF_TEXT_STRING | text is a raw character sequence (see Remarks); cannot be combined with other flags. |
IXFile represents text as length-prefixed by default. Actual text data in file is preceded with a long number specifying length of the text in characters. If text is formatted as length-prefixed its length is read first and then the exact number of characters. Only complete text can be read - at least 4 bytes must be available in file for length prefix, which can be zero (empty text).
If text is formatted as NULL- or CR/LF-terminated, characters are read from file until terminating character is found. CR/LF-terminated text can be terminated with either CR, LF or CR/LF pair. End of file also correctly terminates text even if terminating character was not found.
If Format have IXF_TEXT_STRING flag set, text is read as a raw sequence of characters of specified length, without regard to termination or length prefix. This option should be used with care because there is no control of what data is read. Length of text must be known in advance to avoid reading non-textual data.
Unicode version of the method should not be confused with Unicode system calls or Unicode text data. All versions of the method can be used on Unicode and non-Unicode systems depending on your needs; text is always read as a single byte character sequence. Conversion between ANSI and Unicode is performed internally according to current codepage which can be changed with SetCodePage method. See Unicode Support for more information on Unicode system calls, Unicode methods and Unicode text data.