LOAD FILE - IN

The LOAD FILE statement loads the contents of a file into a text variable.

Syntax:

LOAD FILE <TEXT or TEXT-VAR> IN <TEXT-VAR>

Example:

LOAD FILE "myFolder/myTextFile.txt" IN myVariable

Error codes:

If the LOAD operation should fail, the following values will be returned into the ERRORCODE and ERRORTEXT variables:

  • ERRORCODE: 1

  • ERRORTEXT: "The file '<filename>' couldn't be opened."

Always use the ERRORCODE variable to check if the operation was successful or not. Do not use ERRORTEXT for anything else than displaying the error found, as its contents may change in future releases of LDPL.