|
<< Click to Display Table of Contents >> Navigation: 3. Script Language > Arrays and Data-Structures > ARS. - Array's > !ARS. - File List Operations > ARS. - File List Operations |
MiniRobotLanguage (MRL)
ARS.GetPaths
Load the container with all files in a folder matching a mask (full paths).
Intention
The ARS.GetPaths command loads the container with the full paths of all files in a specified folder that match a given mask. The full paths (including folder) are added to the container.
Illustration:
Folder: C:\MyFolder
Mask: *.txt
┌───────────────────────────────┐
│ C:\MyFolder\File1.txt │
├───────────────────────────────┤
│ C:\MyFolder\File2.txt │
├───────────────────────────────┤
│ C:\MyFolder\File3.txt │
└───────────────────────────────┘
The container is loaded with full paths of files matching the mask.
Syntax
ARS.GetPaths|$$ARR|$$FOLDER|$$MASK
Parameter Explanation
P1 - $$ARR The handle of the Deque.
P2 - $$FOLDER The folder path to search for files.
P3 - $$MASK The file mask to match (e.g., *.txt).
Example
'***********************************
' ARS.GetPaths - Sample Script
'***********************************
' Create a new Deque
ARS.New|$$DEQ
' Load full paths of files matching the mask
ARS.GetPaths|$$DEQ|C:\MyFolder|*.txt
' Display the first full path
ARS.PeekFirst|$$DEQ|$$RES
DBP.The first file path is: $$RES
' End the script
ENR.
Remarks
-
Limitations:
- The folder must exist, and the mask must be valid.
See also:
• ARS.New