• No results found

Functions can be used withinexpressionsto perform various operations on variables, strings and data.

Absolute

Returns an absolute value of the specified numeric parameter, which is the number without positive or negative indication.

Definition

${Absolute(number)}

number- Any number or variable containing a number.

Examples

${Absolute(-10.5)} - Returns the value 10.5 ${Absolute(3-8)} - Returns the value 5

Concat

Concatenates all parameters and returns a single string. At minimum two parameters are required, but multiple parameters are accepted.

Definition

${Concat(text, text[, text...])}

text- Any string, variable or function that returns a string value.

Examples

${Concat('A', 'B')} - Returns the string value "AB"

${Concat(CurrentTimestamp('MM_dd_yyyy'), '.txt')} - Returns the example value "12_31_2011.txt" ${Concat(city, ", ", state, " ", zip)} - Returns the example value "Omaha, NE 68137"

Contains

Searches the text in the first parameter for the value in the second parameter. An optional third parameter can indicate if the search is case sensitive.

Definition

${Contains(haystack, needle[, case Sensitive])} haystack- The text or variable that will be searched. needle- The search string.

caseSensitive- Determines whether the search is case sensitive. Valid values are true and false. The default is true.

Examples

${Contains('example', 'mp')} - Returns "true" since 'mp' is contained in 'example'

${Contains(x, 'xlsx', false)} - Returns "true" since the variable x contains FILE.XLSX and case sensitivity was turned off

CurrentTime

Returns the current time. If atime patternis not specified, the time is formatted using the ISO 24-hour standard.

Definition

${CurrentTime([pattern])}

pattern- A string or variable containing a time pattern.

Examples

${CurrentTime()} - Returns the value "HH:mm:ss" (for example, 13:30:24) ${CurrentTime('hh:mm a')} - Returns the example value 1:30 PM

CurrentTimeMillis

Returns the current time in milliseconds.

Definition

${CurrentTimeMillis()}

Example

${CurrentTimeMillis()} - Returns a numerical value

CurrentTimestamp

Returns the current timestamp. If a pattern is not specified, the time is formatted using the ISO standard fordate and timepatterns.

Definition

${CurrentTimestamp([pattern])}

pattern- A string or variable containing a timestamp pattern.

Examples

${CurrentTimestamp()} - Returns "yyyy-MM-dd HH:mm:ss.SSS" (for example, 2011-12-31 13:30:24.785)

${CurrentTimestamp('MM/dd/yyyy HH:mm')} - Returns the example value 12/31/2011 13:30

Decimal

Returns the numeric value contained within the parameter. Useful for converting strings to numbers.

Definition

${Decimal(text)}

text- Any string, variable or function that returns a string value.

Example

${Decimal('10.00')} - Returns 10.00.

EncryptPassword

Encrypts the value by using theGoAnywhere Directorencryption logic for passwords (same as clicking the Encrypt button). This is useful for encrypting passwords that are stored externally for future use inGoAnywhere Director Projects.

Definition

${Encrypt(text)}

Parameter

text- Any string, variable or function that returns a string value.

Example

EndsWith

Checks if the text in the first parameter ends with the value of the second parameter. An optional third parameter can indicate if the search is case sensitive.

Definition

${EndsWith(haystack, needle[, case Sensitive])} haystack- The text or variable that will be searched. needle- The search string.

caseSensitive- Determines whether the search is case sensitive. Valid values are true and false. The default is true.

Examples

${EndsWith('example', 'le')} - Returns "true" since 'example' ends with 'le'

${EndsWith(x, 'xlsx', false)} - Returns "true" since the variable x contains FILE.XLSX, and case sensitivity was turned off

FileInfo

Returns information on theLocal Filespecified, such as size, last modified date, file directory, etc.

Definition

${FileInfo(filePath)}

filePath- Any string, variable or function that returns a file path.

Examples

${FileInfo("C:\example.txt"):exists} - Returns true or false indicating whether or not the file exists. ${FileInfo("resource:smb://resourceName/file.txt"):size} - Returns the file size of the specified file in a Network Sharesresource.

FormatNumber

Returns a string value for the number in the first parameter formatted with thepatternspecified in the second parameter.

Definition

${FormatNumber(number, pattern)} number- Any number or variable.

pattern- A string or variable containing a number pattern.

Examples

${FormatNumber(10, '#.00')} - Returns the value 10.00

${FormatNumber(9110.997,'$#,##0.00')} - Returns the value $9,111.00

FormatTimestamp

Converts the time in milliseconds to the format defined in thedate and timepattern.

Definition

${FormatTimestamp(timeInMillis, pattern)} timeInMillis- Any millisecond value or variable.

IsEmpty

Returns "false" if there are any non-blank characters. Otherwise, returns "true" if the parameter is empty after trimming all leading and trailing whitespaces.

Definition

${IsEmpty(text)}

text- Any string, variable or function that returns a string value.

Examples

${IsEmpty(x)} - If the variable "x" contains a value then the function returns "false" ${IsEmpty(' ')} - Returns the value "true"

IsNull

Returns "true" if the value of the parameter is null. Otherwise, it will return "false".

Definition

${IsNull(value)}

value- Any string, variable or function.

Examples

${IsNull(null)} - Returns the value "true" ${IsNull('0')} - Returns the value "false"

${IsNull(data[1])} - Returns "true" or "false" based on the value in a rowset column

LastPositionOf

Returns the last position where the value of the second parameter is found in the first parameter. If there is no match, a value of -1 is returned. An optional third parameter can indicate if the search is case sensitive.

Definition

${LastPositionOf(haystack, needle[, case Sensitive])} haystack- The text or variable that will be searched. needle- The text search string.

caseSensitive- Determines whether the search is case sensitive. Valid values are true and false. The default is true.

Examples

${LastPositionOf('SELECT', 'S')} - Returns a value of 1 since the first character is the letter "S". ${LastPositionOf('SELECT', 'e')} - Returns a value of -1 since there is no case sensitive match. ${LastPositionOf('SELECT', 'E')} - Returns a value of 4 since the last position the letter "E" appears is the fourth position.

${LastPositionOf('SELECT', x, false)} - Returns a value of 5 since the variable contains to 'c' and case sensitivity is turned off.

Length

Returns the length of the characters contained in the parameter.

Definition

${Length(text)}

text- Any string, variable or function that returns a string value.

Examples

${Length('SELECT')} - Returns the value 6.

Lower

Returns the parameter in lowercase format.

Definition

${Lower(text)}

text- Any string, variable or function that returns a string value.

Example

${Lower('EXAMPLE')} - Returns the value "example"

LTrim

Trims all leading whitespaces.

Definition

${LTrim(text)}

text- Any string, variable or function that returns a string value.

Example

${LTrim('    example')} - Returns the value "example"

PositionOf

Returns the position where the value in the second parameter is found in the first parameter. The optional third parameter can indicate the starting position of the search. An optional fourth parameter can indicate if the search is case sensitive. The result returns -1 if the text is not found.

Definition

${PositionOf(haystack, needle[, startPos][, caseSensitive])} haystack- The text or variable that will be searched.

needle- The search string.

startPos- The position to start the search. If not specified, the search will start in position 1.

caseSensitive- Determines whether the search is case sensitive. Valid values are true and false. The default is true.

Examples

${PositionOf('example', 'e')} - Returns a value of 1 since the first character is the letter "e" ${PositionOf('example', 'e', 2)} - Returns a value of 7 since the search started at position 2 ${PositionOf('example', 'x', 3)} - Returns a value of -1 since "x" was not found after position 3 ${PositionOf('example', 'A', 2, false)} - Returns a value of 3 since the letter "a" was within the search scope and the search was not case sensitive.

RandomNumber

Generates a random number between the lower limit specified by the first parameter and the upper limit specified by the second parameter. If only one parameter is specified, then the minimum value is 0. When no parameters are specified, the minimum is 0 and the maximum is 2,147,483,647.

Definition

Replace

Searches the text in the first parameter for thesearch patternin the second parameter and replaces it with the value in the third parameter.

Definition

${Replace(text, regex, replacement)}

text- Any string, variable or function that returns a string value. regex- Any text or a regular expression.

replacement- Any text, a variable containing text or a regular expression.

Examples

${Replace('example', 'ex', 's')} - Returns the value "sample"

${Replace('abc.txt', '(.*)\.txt', '$1.csv')} - Returns the value "abc.csv"

RTrim

Trims all trailing whitespaces.

Definition

${RTrim(text)}

text- Any string, variable or function that returns a string value.

Example

${RTrim('example     ')} - Returns the value "example"

StartsWith

Checks if the text in the first parameter starts with the value of the second parameter. An optional third parameter can indicate if the search is case sensitive.

Definition

${StartsWith(haystack, needle[, caseSensitive])} haystack- The text or variable that will be searched. needle- The search string.

caseSensitive- Determines whether the search is case sensitive. Valid values are true and false. The default is true.

Examples

${StartsWith('example', 'ex')} - Returns "true" since 'example' starts with 'ex'

${StartsWith('Text', 't', false)} - Returns "true" since case sensitivity is turned off and 'Text' starts with 't'

String

Returns the value as a string. This is useful for converting numbers to strings.

Definition

${String(value)}

value- Any variable or function that can be returned as a string value.

Example