Search for folders
1. findFolders path:="C:\c";
2. findFolders path:="C:\c" addpath:=1;
Please refer to the page for additional option switches when accessing the x-function from script
Display Name |
Variable Name |
I/O and Type |
Default Value |
Description |
---|---|---|---|---|
path to look for subfolders | path |
Input string |
|
input path to look for subfolders |
add root path to all resulting folder | addpath |
Input int |
|
add root path to all resulting folder or not |
number of sub folders found | n |
Output int |
|
output the number of sub folders found |
result folder names separated by CRLF | folder |
Output string |
|
output result file names separated by CRLF |
This X-Function is used to search folders in specific path and conditions.
This example shows:
dlgPath;// Open a dialog to pick path. Selected folder name will be saved in path$ type -a "You have choosen " + path$; findFolders;// find subfolders under path specified in path$. All found path will be put to folder$, separated by CRLF, by default full path is not added if(folder.GetLength() < 1) { type "No subfolders found"; break 1; } int nn = folder.GetNumTokens(CRLF); type "$(nn) subfolders found"; string strTemp$; for(int ii = 1; ii <=nn; ii++) { strTemp$ = folder.GetToken(ii, CRLF)$; pe_mkdir strTemp$; //Create these folders under current folder in Project Explorer of Origin. }
Keywords:root, subfolder