Skip to content

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:

Result string = $func::Function name( input parameter )

The following functions are available in the script package:

$func::getfilename({string})

  • Determines the file name (without suffix) from the transferred character string. Examples

    $func::getfilename(C:\Test\log.txt)  log
    $func::getfilename(C:\Test\log)  log
    $func::getfilename(log.txt)  log
    $func::getfilename("C:\Test\log.txt")  log
    $func::getfilename(C:\Test\log\) <empty>
    $func::getfilename() <empty>
    $func::getfilename("") <empty>
    
  • Searches for a file (name with suffix) with wildcards. Example

    $func::getfilename(C:\Test\*.txt)  C:\Test\test.txt (returns the first file that matches the search filter)
    

$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

$func::getsysvar(TEMP)  returns the value behind the system variable "TEMP", in this case it would be the system's
temp directory.