txt_load(TEXT*,STRING* filename)

txt_loadw(TEXT*,STRING* filename)

Opens an 8-bit ASCII (txt_load) or 16-bit Unicode (txt_loadw) text file, reads its content into separate strings of a text object, and closes the file. This instruction can be used to fill an empty text object from a file.

Parameters:

filename Name of the text file to be read, STRING* or char*.
TEXT* TEXT object to be filled.

Returns:

Number of strings filled.

Remarks:

Speed:

Slow

Example:

TEXT* bigtext = { strings = 10000; flags = SHOW; } // empty text with a lot of strings
...
txt_load(bigtext,"bigfile.txt"); // fill the text, allocate strings

See also:

TEXT, file_str_readto, Unicode

► latest version online