|
<< Click to Display Table of Contents >> Navigation: 3. Script Language > Arrays and Data-Structures > LST. - List Arrays > File-List Operations > Smart Package Robot 's List Commands |
MiniRobotLanguage (MRL)
LST.GetFiles
Load file names (without paths) into the container
Intention
The LST.GetFiles command loads file names (without paths) from a specified folder into a container. The file names are filtered using a file mask (e.g., *.txt). This is useful for processing or listing files in a directory.
The command takes three parameters: the handle of the container, the folder path, and the file mask.
Syntax
LST.GetFiles|P1|P2|P3
Parameter Explanation
P1 - The handle of the container. This is typically a variable that contains the handle of the container.
P2 - The folder path from which to load the file names.
P3 - The file mask to filter the file names (e.g., *.txt).
Example
'***********************************
' LST.GetFiles Sample
'***********************************
' Create a new list
LST.New|$$LST
' Load file names from a folder into the list
LST.GetFiles|$$LST|C:\Temp|*.txt
' Display the number of files loaded
LST.Count|$$LST|$$CNT
DBP.Number of files loaded: $$CNT
' End the script
ENR.
Remarks
-
Limitations:
- The folder path must exist and be accessible.
- The file mask must be valid (e.g., *.txt).
See also:
• LST.Count - Get Number of Items in Container
• LST.TextGet - Get Container Contents as Text Document