Functions¶
Functions offer the possibility of carrying out operations on character strings in order to obtain a defined result string. In general, the following applies:
The following functions are available in the script package:
$func::getfilename({string}
)¶
-
Determines the file name (without suffix) from the transferred character string. Examples
-
Searches for a file (name with suffix) with wildcards. Example
$func::getdir({string}
)¶
Determines the path name from the transferred string.
Examples
$func::getdir(C:\Test\log.txt) → C:\Test\
$func::getdir(C:\Test\log) → C:\Test\
$func::getdir(log.txt) →<empty>
$func::getdir(C:\Test\log\) → C:\Test\log\
$func::getdir(NULL) →<empty>
$func::getdir("") →<empty>
$func::getshortdir({string}
)¶
Converts the transferred path into the system-supported short form.
Example
$func::getshortdir(p:\vdBuild\vdC\ExampleComponents\Schneider Modsoft CatExample) → p:\vdBuild\vdC\BEISPI~1\SCHNEI~2\
$func::getparentdir({string}
)¶
Determines the path name from the transferred string.
Examples
$func::getparentdir(C:\Test\log.txt) → C:\Test
$func::getparentdir(C:\Test\log) → C:\Test
$func::getparentdir(log.txt) →<empty>
$func::getparentdir(C:\Test\log\) → C:\Test
$func::getparentdir(NULL) →<empty>
$func::getparentdir("") →<empty>
$func::getdrive({string}
)¶
Determines the drive letter from the transferred character string. It is assumed that the drive is only described by ONE letter. If the drive letter cannot be recognized, the return value is empty.
Examples
$func::getdrive(C:\Test\log.txt) → C
$func::getdrive(C:\) → C
$func::getdrive(C$) → C
$func::getdrive(\\Network\C$) → C
$func::getdrive(\\Network\C$\Temp) → C
$func::getdrive(\\Network\C\Temp) → C
$func::getdrive(C\) → C
$func::getdrive(\\Network\Temp\C\Temp) →<empty>
$func::getdrive(CD) →<empty>
$func::getdrive() →<empty>
$func::getsysvar({string}
)¶
Determines the environment variable/system variable that is assigned to the transferred character string.
Example