KB-127368: Functions

Functions

Functions offer the possibility to execute operations on strings to obtain a defined result string. The following generally applies:

Result string = $func::function name (Input parameters)

The following functions are available in the scripting package:

$func::getfilename(<string>)

  1. Determines the file name (without suffix) of the input string.
    1. Examples
  2. $func::getfilename(C:Testlog.txt) → log
  3. $func::getfilename(C:Testlog) → log
  4. $func::getfilename(log.txt) → log
  5. $func::getfilename(„C.Testlog.txt“) → log
  6. $func::getfilename(C:Testlog) →<empty>
  7. $func::getfilename() →<empty>
  8. $func::getfilename(“„) →<empty>
  9. Searches for a file (name with suffix) with wildcards.
    1. Example
  10. $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

Related Articles

IMPRINT | PRIVACY POLICY | COOKIE POLICY

Privacy Preference Center