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:
- This instruction uses file_str_read to parse the file content into
separate strings. The text strings are created as variable length
strings. If the file contains more strings than the text, the rest
will be omitted.
- Apart from the division into separate strings, the file content
won't be modified, f.i. "\n" characters will not be converted to
line feeds.
- As with file_str_read, the text file
must physically exist in the game folder.
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