$todate

Converts an expression to the date data type.

Syntax

$todate(expression)

Parameters

expressionAny expression. To be meaningful, it should yield a number that has meaning in the format YYYYMMDD.

Return Value

Date.

Example

$date - $todate(19980923)

In the preceding arithmetic expression, 19980923 is treated as the date 23 September 1998 instead of the number 19,980,923. Assuming that $Date is 19981023, the expression evaluates to 30.

See Also

$toalpha

$tocharacter

$tonumber

$ltrim

Trims leading blanks from a character string.

Syntax

$ltrim(string)

Parameters

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

Return Value

Character string.

Comments

Use $ltrim to remove leading spaces from a character string.

For output purposes, the implicit length of the result returned by $ltrim is the same as the length of string.

Example

$ltrim(Salary)

Evaluates to “20000” if Salary is 20,000 (INT data type).

See Also

$trim

$ttrim

$GroupID

The current user’s operating system group ID.

Syntax

$groupid

Return Value

A character string, or $Null. Cannot be reset by an application program.

Description

The current user’s operating system group ID (if the operating system supports group IDs); otherwise, $Null.

You can use the $UserID and $GroupID system variables to build levels of security into your applications.

During a Zim session, you also can LOGIN to the software under any defined UserName (in EntitySet Users). $ZUserID and $ZGroupID are then set to the UserID and GroupID associated with UserName; $UserID and $GroupID (containing values taken from the operating system) are still available for use.

See Also

$UserID

$ZGroupID

$ZUserID

System Variables

SET CHECKNULLS

Controls required field checking for EntitySets and relationships with fields.

Syntax

SET CHECKNULLS ON|OFF

Comments

The CHECKNULLS option is set ON by default.
When CHECKNULLS is ON, an error results if a Required field is assigned the $Null property during an ADD, CHANGE, INSERT, or UPDATE command. Normally, you should always leave CHECKNULLS set ON.
Even if you switch null checking OFF, you should always explicitly or implicitly assign some value to every required field.

Note: A field is Required if its definition in the Object Dictionary specifies yes for Reqd.

See Also

ADD

CHANGE

INSERT

UPDATE

$trim

Trims leading and trailing blanks from a character string in a field.

Syntax

$trim(string)

Parameters

stringa character string, or any expression that evaluates to a character string

Return Value

Character string.

Comments

Use $trim to remove leading and trailing spaces from a character string in a field.

For output purposes, the implicit length of the result returned by $trim is the same as the length of string.

Example

$trim(LastName)

Evaluates to “Smith” if LastName is stored as ” Smith “.

See Also

$ltrim

$ttrim

BOTTOM

Makes the last member of a result set the current member.

Syntax

BOTTOM [setname]

Parameters

setname

The name of a result set. If a setname is not specified, the current set is used.

Example

To find all Employees with Jones as a last name, to identify the result set as KeepName, and to set the current member pointer to the last member of KeepName, enter

find all Employees where LastName = “Jones” -> KeepName

bottom KeepName

To move the current member pointer to the last member in the current set, enter

bottom

 

See Also

$currentmember

DOWN

LOCATE

NEXT

UP

$ZUserID

$ZUserID

The application user’s Zim user identifier.

Syntax

$zuserid

Return Value

The user identifier of the user specified in the last successful LOGIN command. Cannot be reset by an application program.

Description

Upon successful execution of a LOGIN command, $ZUserID is set to the specified user’s ID.

Although you can change the value of this variable, you cannot change the effect of the LOGIN command. The software continues to treat the current user according to the GroupID and UserID associated with the UserName given in the last LOGIN command.

When you call up any Zim system (full, Runtime, etc.), the software automatically attempts to log you in as a user called ZIM.

 

See Also

$GroupID

$UserID

About Character Literals

LOGIN

System Variables

PRINT REPORT

Prints or displays a graphical reports previously created.

Syntax

PRINT REPORT name TO destination

Parameters

name

The name of a Zim document that contains the graphical report.

destination

The destination can be the SCREEN or to the PRINT.

Comments

The Zim document specified by name must contain a graphical report previously generated by a REPORT FROM command with the GRAPHIC option. The document can be printed any number of times.

If the destination is the printer, the report is printed automaticaly without operator’s intervention.

If the destination is the screen, the report can be visualized and then, optionally, printed and/or written to a PDF format file.

Examples:

PRINT REPORT MyDoc TO SCREEN

PRINT REPORT AnotherDoc TO PRINT

 

See Also

$getproperty

$printersetup

$screenprint

$setproperty

FORM REPORT

SET OUTPUT

$LastErrCode

The error code generated by the last command that returned an error code.

Syntax

$lasterrcode

Return Value

A number (1 to 9999). Can be reset by an application program.

Description

The reason for the failure of the most recently executed command that returned an error code other than 0 (success)

At the beginning of each application session, $LastErrCode is set to $Null. Its value then changes only if a command returns an error code, or the application program explicitly assigns it a new value.

Explanations for many error codes are contained in the ErrorHelp entity set, which you can access from your database application using the DESCERR or EXPLERR utility program.

See Also

$ErrCode

$ErrLevel

$LastErrLevel

$LastErrMessage

$MaxErrLevel

System Variables

$adddays

Calculates a date value by adding days to (or subtracting days from) from a specified date value.

Syntax

$adddays(date,number)

where

datea date, or an expression that evaluates to a DATE data type
numbera number, or an expression that evaluates to a number

Return Value

Number, representing a DATE value.

Comments

Use $adddays to perform arithmetic with date values. $Adddays calculates a date value by adding a number representing days to a date value. If number is negative, the effect is to subtract the days from the date.

The + (add) and – (subtract) operators can be used to achieve the same results.

If date or the result of the functional expression is an invalid date (e.g., 19930231), it is adjusted to produce a valid date (e.g., 19930228).

Example

If $Date has the value 19981225, then

$adddays($date,5)

Evaluates to 19981230.

$adddays($date,7)

Evaluates to 19990101.

$adddays($date,-5)

Evaluates to 19981220.

$adddays(19990201,30)

Evaluates to 19990303.

en_CAEnglish