txt_for_dir(text,STRING* name)
Reads all file names that match the given string into
separate
strings
of
a
text
object. This instruction can be used to scan a folder.
Parameters:
| name |
file names (C-style with wildcards) to be matched. |
| text |
TEXT object to be filled |
Returns:
Number of strings filled.
Speed:
Slow
Remarks:
- '*' and '?' wildcards and subfolders can be used. "*.*" matches
all files, "texts\\*.txt" matches
all files with txt extension in the texts subfolder.
Do not use absolute path addresses as they probably won't work on the end user's
systems.
- Only non-empty files will be found. The RESOURCE and PATH statements
will not be used for searching the files.
- Found files can be opened with file_open_read or file_open_write.
Example:
TEXT tDir = { strings = 10; } // empty text with a lot of strings
...
txt_for_dir(tDir,"*.txt"); // fill file names into the text strings
tDir.visible = on;
See also:
txt_load