Functions
Functions offer the possibility to execute operations on strings to obtain a defined result string. The following generally applies:
The following functions are available in the scripting package:
$func::getfilename(<string>
)
- Determines the file name (without suffix) of the input string.
- Examples
- $func::getfilename(C:Testlog.txt) → log
- $func::getfilename(C:Testlog) → log
- $func::getfilename(log.txt) → log
- $func::getfilename(„C.Testlog.txt“) → log
- $func::getfilename(C:Testlog) →
<empty>
- $func::getfilename() →
<empty>
- $func::getfilename(“„) →
<empty>
- Searches for a file (name with suffix) with wildcards.
- Example
- $func::getfilename(C:Test*.txt) → C:Testtest.txt (delivers the first file that meets of the criteria of the search filter)
$func::getdir(<string>
)
Delivers the path name from the given string.
Examples
$func::getdir(C:Testlog.txt) → C:Test
$func::getdir(C:Testlog) → C:Test
$func::getdir(log.txt) → `<empty>`
$func::getdir(C:Testlog) → C:Testlog
$func::getdir(NULL) → `<empty>`
$func::getdir(“„) → `<empty>`
$func::getshortdir(<string>
)
Converts the transferred path into the system-supported short form.
Example
$func::getshortdir(p:vdBuildvdCBeispielkomponentenSchneider Modsoft Katexample) → p:vdBuildvdCBEISPI~1SCHNEI~2
$func::getparentdir(<string>
)
Delivers the path name from the given string.
Examples
$func::getparentdir(C:Testlog.txt) → C:Test
$func::getparentdir(C:Testlog) → C:Test
$func::getparentdir(log.txt) → `<empty>`
$func::getparentdir(C:Testlog) → C:Test
$func::getparentdir(NULL) → `<empty>`
$func::getparentdir(“„) → `<empty>`
$func::getdrive(<string>
)
Determines the drive letters from the given string. It is assumed that the drive is described with only ONE letter. If the drive letter cannot be recognized, the return value is empty
Examples
$func::getdrive(C:Testlog.txt) → C
$func::getdrive(C:) → C
$func::getdrive(C$) → C
$func::getdrive(\NetworkC$) → C
$func::getdrive(\NetworkC$Temp) → C
$func::getdrive(\NetworkCTemp) → C
$func::getdrive(C) → C
$func::getdrive(\NetwerkTempCTemp) → `<empty>`
$func::getdrive(CD) → `<empty>`
$func::getdrive() → `<empty>`
$func::getsysvar(<string>
)
Determines the environment variable / system variable assigned to the given string.
Example
$func::getsysvar(TEMP) → returns the value behind the system variable „TEMP“, in this case it would be the temp directory of the system.
Last update: September 15, 2023