txt_load(text,STRING* filename)

Opens a 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
text TEXT object to be filled

Returns:

Number of strings filled.

Remarks:

Speed:

Slow

Example:

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

See also:

file_str_read