$isodd

Tests if a number is odd.

Syntax

$isodd(expression)

Parameters

expressiona number, or an expression that evaluates to a number

Return Value

If expression evaluates to an odd number, the function returns “1” ($True); if expression evaluates to an even number, the function returns”0″ ($False)

If expression does not evaluate to a number, the software raises an error.  The function returns “0” ($False).

Comments

Expression is rounded before testing.

Example

$isodd(vAmount)=$False

Evaluates to $True if vAmount is even.

$isodd(-5)

Evaluates to $True.

$isodd(Salary*1.1)

Evaluates to $False if Salary is 20,000.

$isodd("123.4")

Evaluates to $True.

$isodd("abc")

Evaluates to $False.

See Also

$isnumber

About Functional Expressions

$month

Extracts the month number associated with a specified date value.

Syntax

$month(date)

Parameters

datea data, or an expression that evaluates to a date, in the form YYYYMMDD

Return Value

Character string.

Comments

This function extracts month information from standard date values. Date is often the system variable $Date.

Example

$month(19931225)

Evaluates to “12”.

$month($date+7)

Evaluates to “1” when $Date is 19991225.

See Also

$addmonths

$Date

$day

$dayname

$monthname

$weekday

$year

About Data Types

About Functional Expressions

$isdigit

Tests if a character string contains only digits.

Syntax

$isdigit(string)

Parameters

stringa character string or an expression that evaluates to a character string

Return Value

1-character binary string. Evaluates to 1 ($True) if string meets the validation test; otherwise, evaluates to 0 ($False).

Comments

This function tests if a particular character string is all digits.

Example

$isdigit("0123")

Evaluates to $True.

$isdigit(2.3)

Evaluates to $False.

See Also

$isalphabetic

$isalphanumeric

$isdate

$islower

$isnumber

$isupper

$iszimname

About Character Literals

About Functional Expressions

$ObjEventName

Obtain the name of the current event.

Syntax

$ObjEventName

Return Value

Returns a string.

Warning

COM objects are being discontinued by Microsoft and may not be available in future releases of Zim-X.

$DBName

The name of the database as provided in the connection.

Syntax

$dbname

Return Value

A character string. Cannot be reset by an application program.

Description

The $DBName function is set to the value of the database name provided as a connection parameter.

See Also

$DBPath

$SQLPath

The file system path for the Zim Server Access Modules (SAM).

Syntax

$sqlpath

Value

The pathname of the directory pointed to by the SQLCPI variable.

Description

The SQLCPI variable is defined in the registry. The SQLCPI variable indicates the directory containing the Zim Server Access Modules.

$fieldnum

The field number of the current form field.

Syntax

$fieldnum

Return Value

A number. ZIM sets the $FieldNum to the field number (FNum) of the form field in which the cursor is located when FORM INPUT terminates.

Comments

The combination of $FormNum, $Subscript and $FieldNum can uniquely identify a particular form field in a Zim display.

$subscript

The current instance of the current form

Syntax

$subscript n

Parameters

nAny numeric value between 1 and 8

Comments

In combination of $FormNum, $subscript, $ FieldNum can uniquely identify a particular for field in a Zim display.

Example

form set (reverse) ($ formnum,$ fieldnum,$subscript)

Sets the current instance of a repeated form to reverse video.

find Products where ProdCode = fProducts.ProdCode [$subscript]

Finds all product records that match the product code on the current instance of the repeated form fProducts.

$MD5

Returns a cryptographic 128-bit hash value.

Syntax

$md5(expression)

Parameters

expressionan expression that evaluates to a string

Return Value

The value returned by $MD5 is a hexadecimal 32-characters long string representing the cryptographic hash value of the expression used as the argument.

Example

out $md5(1)
45954632C04A953592D33FDC5F59A64C
out $md5("1")
C4CA4238A0B923820DCC509A6F75849B

The returned values are different because the $md5(1) first converts the number 1 to a character string (which becomes ”       1″) and then applies the MD5 algorithm to it.

$ObjErrCode

Provides the failure error code returned by a component function.

Syntax

$ObjErrCode

Return Value

Number (LONGINT). Can be reset by an application program.

Comments

The variable gives the failure error code returned by a component function. This variable is set to $null when a component operation triggers a Zim error and is set to a meaningful value when a Zim 5207 error is encountered.

Warning

COM objects are being discontinued by Microsoft and may not be available in future releases of Zim-X.

pt_BRPortuguese