Skip to main content
Skip table of contents

General functions

Overview

  • The Evaluate function treats input text as an expression to be parsed and evaluated.

  • The GetEnv function returns the value of specified environment variable.

  • The Min and Max functions find the smallest or largest value in a list of values.

Evaluate

Interprets text as an expression to be parsed and evaluated.

Syntax

Evaluate( text )

The required argument text may be of any type, but the input text is interpreted as a literal expression. The returned value is text, regardless of the natural type of the expression. Any errors encountered while parsing the expression will result in an <Error> value on output, and parsing error messages will be sent to the message log.

Remarks

This function is useful for building dynamic operations from data stored in a file or database. If you use the Evaluate() function to repeatedly evaluate the same input text in a Calculate tool expression, overriding the tool's default Evaluate() cache size setting may improve performance.

Example

Evaluate("lowercase(NAME)") returns the results of the expression lowercase( NAME ).

GetEnv

Returns the value of specified environment variable.

Syntax

GetEnv( environmentvariable )

The required argument environmentvariable is the name of a local environmental variable. The returned value is text. 

Remarks

This function searches the environment list to find the specified environment variable, and returns its value as a string.

Example

CODE
IF system.OS = "windows" THEN GetEnv("HOMEPATH")
ELSE GetEnv("HOME")
ENDIF

This returns the home directory of the user.

Min

Accept two or more arguments and returns the smallest of all the arguments.

Syntax

Min( value1, value2, ... valueN )

The required arguments value1 and value2 may be of any type, but all types must be comparable. For example, Integers and Floating Point types are comparable, but Text and Date types are not..

Remarks

Null and Error values are not compared.

Max

Accept two or more arguments and returns the largest of all the arguments.

Syntax

Max( value1, value2, ... valueN )

The required arguments value1 and value2 may be of any type, but all types must be comparable. For example, Integers and Floating Point types are comparable, but Text and Date types are not..

Remarks

Null and Error values are not compared.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.