$tan

Calculates the tangent of a number.

Syntax

$tan(number)

Parameters

numbera number or an expression that evaluates to a number

Return Value

Number, with the same number of decimal places as number. Ensure that you specify enough decimal places in your equation to ensure a sufficiently granular result. Unusual results such as -0 are an indication that the number of decimal places needs to be increased. For example, if you enter

$tan(3)

without any decimal points, you receive the result

-0

However, if you enter

$tan(3.0000)

you receive the result

-0.1425

Comments

The value returned by this function has the same number of decimal places as number.

Example

let var1 = $tan(0)
let var1 = 3.14
let var2 = $tan(0.50*var1)

See Also

$atan

$cos

$sin

$tanh

About Functional Expressions

$cos

Calculates the cosine of a number.

Syntax

$cos(number)

Parameters

numbera number, or an expression that evaluates to a number

Return Value

Number, with the same number of decimal places as number.

Comments

The value returned by this function has the same number of decimal places as number. Ensure that you specify enough decimal places in your equation to ensure a sufficiently granular result. Unusual results such as
-0 are an indication that the number of decimal places needs to be increased. For example, if you enter

$cos(2)

without any decimal points, you receive the result

-0

However, if you enter

$cos(2.0000)

you receive the result

-0.4161

Example

$cos(0)

Evaluates to 1.

let var1 = 3.14
let var2 = $cos(0.50*var1)

Var2 evaluates to 0.00.

See Also

$acos

$cosh

$sin

$tan

About Functional Expressions

$atan2

Calculates the arctangent (in radians) of the quotient of two numbers.

Syntax

$atan2(number1,number2)

Parameters

number1a number, or an expression that evaluates to a number
number2a number, or an expression that evaluates to a number

Return Value

Number, with the same number of decimal places as number1.

Comments

Number1 is divided by number2 before the arctangent is calculated.

The value returned by $atan2 has the same number of decimal places as number1.

Example

$atan2(1.000,2)

The above command is equivalent to $atan(0.500) and returns the value 0.464.

See Also

$acos

$asin

$atan

$tan

$tanh

About Functional Expressions

$concat

Builds a single character string out of separate character strings.

Syntax

$concat(string[«,string»])

Parameters

stringA character string or an expression that evaluates to a character string. Each string must be separated from the next by a comma (,).

Return Value

Character string.

Comments

The function builds a single character string out of separate strings.

Example

$concat($ttrim(FirstName)," ",LastName)

Can evaluate to “John Smith “. Combines three strings.

$concat($ttrim(LastName),", ",$ttrim(FirstName)," ",Initials)

Can evaluate to “Smith, John T.”. Combines five strings.

let Today = $concat($trim($dayname($date)),", ",
$day($date),", ",$monthname($date))

Can evaluate to “Monday, 30, October”. Combines five strings.

See Also

$delete

$insert

$left

$position

$replace

$right

$squeeze

$substring

$translate

$modulus

Calculates one number modulo another.

Syntax

$modulus(expr1,expr2)

Parameters

expr1a number, or an expression that evaluates to a number
expr2a number, or an expression that evaluates to a number

Return Value

Number, with no decimal places.

Comments

Expr1 modulo expr2 is the remainder of the division of expr1 by expr2.

Before the operation is carried out, expr1 and expr2 are rounded, if necessary, to yield integer values.

Example

$modulus(5,2)

Evaluates to 1.

$modulus(5.2,2.43)

Evaluates to 1.

$modulus(Age,10)

Evaluates to 4 if Age is 54.

See Also

About Functional Expressions

$UserFunction

Invokes a special function built by the user.

Syntax

$userfunction(expression-1, expression-2, ...)

Parameters

expression-1Any value, or an expression that yields any value.
expression-2Any value, or an expression that yields any value.

Return Value

The return value is determined by the type and length of expression-1.

Comments for Windows Environments

On Windows environments, the user function is a DLL whose name is assumed to be “#z32func.dll” (it can be defined as any other name) where the symbol “#” denotes the directory where the environment variable ZIM points to (that is where is Zim is installed). You may modify it by setting the environment variable ZIMFUNC in the Registry to point to another location or to another name like this example:

ZIMFUNC     c:program fileszim8.50myfunc.dll

The DLL is loaded the first time the $UserFunction is invoked by a Zim command.

Comments for UNIX Environments

The name of the user function for UNIX environments is assumed to be “#zimfunc” where the symbol “#” denotes the directory where the environment variable ZIM points to (that is where is Zim is installed). You may modify it by setting the environment variable ZIMFUNC in the Registry to point to another location or to another name like this example:

ZIMFUNC=/usr/zim/zimfunc
export ZIMFUNC

The “zimfunc” executable is loaded once the first time the $UserFunction is invoked by a Zim command.

6. the length of the tUserBuf structure, this may or may not be used

7. ensure that you are using 1 byte packing (or /Zp1 on the compile line)

The example program, zfuncwin.c, displays information in a MessageBox

about the arguments that are passed to it from ZIM and returns the

first argument as the result.

To test this example try entering Zim:

list 5 docs format $userfunction (docname, filename)

or

out $userfunction ("hi there")

$or

Performs a bit-wise OR of two values.

Syntax

$or(char1,char2)

Parameters

char1a character string, or an expression that evaluates to a character string
char2a character string, or an expression that evaluates to a character string

Return Value

Character string.

Comments

The $or function combines the bit patterns of two characters in the fashion of a Boolean OR and returns the resulting character.

If the char1 or char2 string contains more than one character, only the first character in the string (one byte) is processed. You can express char1 and char2 as hex codes (e.g., 6E).

Example

$or("E","F")

The bit pattern of hex 0E is 00001110 and of hex 0F is 00001111. The above expression returns the bit pattern 00001111 (hex 0F).

See Also

$and

$not

$ServerFunction

Executes server-side functions.

Syntax

$serverfunction (server specific syntax [«,parameters»])

Parameters

server specific syntax

A character string or an expression that evaluates to a character string containing a server-specific syntax for execution on the server side.

parameters

Zero or more expressions to satisfy the usage of the server-specific syntax.

Return Value

A value created by the server-specific syntax.

Comments

$ServerFunction executes the specific syntax (for a particular server) using the parameters.

The syntax is not parsed and checked, but rather passed through directly to the Server and, therefore, must be accepted and understood there.

Examples

$ServerFunction ("sysfun.left(?,3)",var1)

This will is accepted as is by Oracle.

$ServerFunction("sysfun.left(cast(? as VARCHAR(20),3)",var1)

This syntax is accepted by DB2.

See Also

Server Side Functions with Input Parameters

The Benefits of $ServerFunction

$and

Performs a bit-wise AND of two values.

Syntax

$and(char1,char2)

Parameters

char1a character string, or an expression that evaluates to a character string
char2a character string, or an expression that evaluates to a character string

Return Value

Character string.

Comments

The $and function combines the bit patterns of two characters in the fashion of a Boolean AND and returns the resulting character. If the char1 or char2 string contains more than one character, only the first character in the string (one byte) is processed. You can express char1 and char2 as hex codes (e.g., 6E).

Example

$ and("E","F")

The bit pattern of hex 0E is 00001110 and of hex 0F is 00001111. The above expression returns the bit pattern 00001110 (character hex 0E).

See Also

$not

$or

About Character Literals

About Functional Expressions

$addticks

Calculates a time value by adding ticks to (or subtracting ticks from) a specified time value.

Syntax

$addticks(time,number)

Parameters

timean 8-digit number, or an expression that evaluates to an 8-digit number, that expresses a valid time value in the format HHMMSSTT
numbera number, or an expression that evaluates to a number

Return Value

Number, representing a time value.

Comments

Use $addticks to perform arithmetic with time values. The $addticks function calculates a time value by adding a number representing ticks to a time value. If number is negative, the effect is to subtract the ticks from the time.

Example

If $Time has the value 22503075, then

$addticks($time,5)

evaluates to 22503080.

$addticks($time,25)

evaluates to 22503100.

$addticks($time,-5)

evaluates to 22503070.

$addticks($time,200)

evaluates to 22503275.

See Also

$addhours

$addminutes

$addseconds

$ticks

en_CAEnglish