Quote Originally Posted by ErosOlmi
Here they are PB source.
They can be improved maybe wrapping arounf TRY/CATCH/END TRY

[code=vb]
FUNCTION FILE_Load(BYVAL lFileName AS STRING) AS STRING
LOCAL hFile AS LONG
LOCAL lBuffer AS STRING

ON ERROR RESUME NEXT
IF FILE_EXISTS(lFileName) THEN
hFile = FREEFILE
OPEN lFileName FOR BINARY ACCESS READ AS hFile
SEEK hFile,1 ' Start of file
GET$ hFile, LOF(hFile), lBuffer
CLOSE hFile
FUNCTION = lBuffer
END IF

END FUNCTION
[/code]

thanks

Is it better to add SEEK like above to guarantee that it points to the start of the file.