net/holzammer/fileio/loadtextfile.m

Description:

Contains a function to load a text file into memory

Requirements:

Compiler: CreativE
OS: AmigaOS >=V39
CPU: >=68020

Functions:

loadtextfile()

Purpose: Loads a text file into memory
Usage: buffer,length:=loadtextfile(path)
Parameters: path a STRING with the complete AmigaDOS path to the file to be loaded.
Return Values: buffer an eSTRING containing the content of the file, NIL on failure
length the length of the estring without the closing zero byte
Notes: The garbage collector automatically frees the resources occupied by the buffer at CleanUp of the application. You can previously free memory using the END statement.
Current E compilers limit eSTRINGs to 32 KB ! It's up to you to ensure that the file you want to load is not bigger !