Unicode Controls & Classes for VB6 - Version 4

clsUniFile.st_TextFileToString2a Function

Load a textfile and returns the contained text; This function attemps to check the correct encoding then it will read the file in the right way

Syntax
Public Function st_TextFileToString2a (ByVal sFileName As String, _
ByRef sRetFile As String, _
Optional ByVal iEnc As eFileEncoding = -1&, _
Optional ByVal bRaiseError As Boolean = True, _
Optional ByVal bReadBOM As Boolean = True) As Boolean
Parameters
Parameter Description
ByVal sFileName As String The filename to load
ByRef sRetFile As String Content of file
Optional ByVal iEnc As eFileEncoding = -1& Encoding to use; pass -1& to let the function read the encoding using the BOM at the start of the file or
pass it to a valid enum value to read the file using the specified encoding without reading any BOM
Optional ByVal bRaiseError As Boolean = True If True, raises an error if there is a problem; otherwise it returns False as a result
Optional ByVal bReadBOM As Boolean = True Specify if the function has to read/skip the BOM at the start of the file; if you saved the file without BOM pass False
Remarks