## Arithmetic Operators

Binary arithmetic operators:- ^ exponent
- + addition
- - subtraction
- * multiplication
- / division
- div integer division
- mod remainder

- + sign positive identity
- - sign negation

## Logical Operators

Bitwise logical operators:- not bitwise negation
- and bitwise and
- or bitwise or
- xor bitwise xor
- shl shift left
- shr shift right

- not negation
- and logical and
- or logicalor
- xor logical xor

## Relational Operators

Relational operators:- = equal
- >< not equal
- < less than
- > greater than
- <= less than or equal to
- >= greater than or equal to

## String Functions

**function Upper(S: string): string**

The Upper function returns a string containing the same text as S, but with all 7-bit ASCII characters between 'a' and 'z' converted to uppercase.

**function Lower(S: string): string**

Lower returns a string with the same text as the string passed in S, but with all letters converted to lowercase. The conversion affects only 7-bit ASCII characters between 'A' and 'Z'.

**function Copy(S: string; Index, Count: Integer): string**

The Copy function returns a substring of a string. S is a string-type expression. Index and Count are integer-type expressions. Copy returns a string containing Count characters starting at S[Index]. If Index is larger than the length of S, Copy returns an empty string. If Count specifies more characters than are available, the only the characters from S[Index] to the end of S are returned.

**function Pos(Substr: string; S: string): Integer**

Pos searches for a substring, Substr, in a string, S. Substr and S are string-type expressions. Pos searches for Substr within S and returns an integer value that is the index of the first character of Substr within S. Pos ignores case-insensitive matches. If Substr is not found, Pos returns zero.

**function Length(S: string): Integer**

The Length function returns the number of characters actually used in the string S.

**function Trim(S: string): Integer**

The Trim function returns the string with any leading and trailing spaces and control characters removed.

**function LTrim(S: string): Integer**

The LTrim function returns the string with any leading spaces and control characters removed.

**function RTrim(S: string): Integer**

The RTrim function returns the string with any trailing spaces and control characters removed.

## Conditional Functions

**function If(Condition: Boolean, TrueResult, FalseResult):
ResultType**

Condition is a Boolean expression. When the function is evaluated, it returns TrueResult if Condition else FalseResult. TrueResult and FalseResult need not be of the same type and result type of the IF expression may change depending on Condition.

## Complex Expressions Syntax

In script all complex functions should be contained within curly braces ("{" and "}"). Variables should be enclosed within % symbols and literal strings should be enclosed within double quotes ("). Parameters are separated by commas (,).

Complex expressions are supported in script If statements and Let statement, and since version 9.0 can now also be included within all other commands and function calls in the place of regular variables.

Complex expressions can be disabled at any point by setting the DISABLE_COMPLEX_EXPRESSIONS variable to 1. Switch back on by resetting to 0.

## Examples

Numeric Functions:

```
Let>rounded={round(34.6)}
Let>ans={cos(340)}
```

Using numeric variables in complex expressions we enclose variables in % symbols:

```
Let>decimal=34.6
Let>rounded={round(%decimal%)}
```

String Functions:

In Complex expressions string literals must be enclosed in double quotes ("). Variables are just enclosed with % symbols:

```
Let>email=fred@someserver.com
Let>at={Pos("@",%email%)}
```

Here at equals 5 as it is the 5th character in fred@someserver.com

Let's now use the copy function to extract everything before the @ sign:

```
Let>namepart={copy(%email%,1,%at%-1)}
```

Conditional Functions:

```
Let>email=fred@someserver.com
Let>IsItAnEmail={if(pos("@",%email%)>0,"yes","no")}
```

Of course we could do:

```
Let>email=fred@someserver.com
Let>at={Pos("@",%email%)}
Let>IsItAnEmail={if(%at%>0,"yes","no")}
```

Here IsItAnEmail would be set to "yes".

## Comments

0 comments

Please sign in to leave a comment.