$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

RENAME

Changes the name of certain objects.

Syntax

RENAME object oldname AS newname [IN directory]

Parameters

objectOne of
CONSTANT, DIRECTORY, DISPLAY, DOCUMENT, ENTITYSET, FORM, RELATIONSHIP, ROLE, SET, VARIABLE, WINDOW
oldnameThe current name of object.
newnameThe new name for object. The new name must not be the name of an existing object.
directoryThe name of the application directory in which object is located.

Example

rename entityset Deppartments as Departments

The preceding command renames an EntitySet that was accidentally given a misspelled name.

See Also

CREATE

ERASE

How To Name Objects

$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

PAGE LEFT

Specifies the vertical heading for each page in a column-oriented report.

Syntax

PAGE LEFT reportitem [:format:]

Parameters

reportitemAny valid expression. Complex expressions must be enclosed in parentheses. When you specify more than one expression, each must be separated from the next by at least one space.
formatA set of instructions defining the format for the associated reportitem. Format is enclosed in : (colons) and can consist of any valid combination of format options.

Comments

The PAGE LEFT command generates a “heading” along the left-hand edge of each page in a column-oriented report. The column of text generated by this command starts in column 1 on the page. Report items in this command can include individual data values only from the first record to be processed on the current report page.

See Also

How to Use The Report Generator

Output Masks

Report Item Format Options

WHERE

Controls the evaluation of other expressions.

Syntax

expression1 WHERE expression2

Parameters

expression1A value expression.
expression2A logic expression using conditional and Boolean operators.

Return Value

If expression2 is logically true, the value of expression1; otherwise, $Null.

Example

let i = { 1 where Age < 10,
2 where Age between 10 and 30,
4 where Age > 50, 3 }

Assigns a value to the variable i based on Age.

compute Employees evaluate
(let TotSal = $total(Salary where LastName = “Smith”)

Finds the total of the salaries of all employees named Smith.

See Also

About Boolean Expressions

About Conditional Expressions

Conventions

LET

Special Expression Formats

TRANSACTION

Starts an explicit transaction.

Syntax

TRANSACTION [READ]

Parameters

READThis option is ignored.

Comments

TRANSACTION marks the start of a sequence of commands that are to be handled as a single transaction. The transaction can be terminated either with an ENDTRANSACTION or  with a QUITTRANSACTION command.

TRANSACTION sets the system variable $InTransaction to $True.

Example

form set accelerator Return Escape

while

 form open fEmpForm

 form display input

 if Event.EventName <> “Escape”

  find Departments where Departments.Dno=fEmpForm.Dno

  if $setcount = 0

   form open fDeptForm

   form display input

  endif

  transaction

   if $setcount = 0

    add Departments from fDeptForm

   endif

   add Employees from fEmpForm

  endtransaction

 else

  return

 endif

endwhile

See Also

BEGIN WORK

ON

QUITTRANSACTION

SET TRANSACTION FLOW

$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")

GENERATE

Generates application code from a template.

Syntax

GENERATE zimprog [ (parm)|string ]

Parameters

zimprogThe name of an application document that contains an application program template.
parmAn expression whose value is to be passed to zimprog. Multiple parameters must be separated from one another by commas.
stringA string that is passed to zimprog if zimprog is a macro program.

Comments

The commands in zimprog are executed interactively. When an opening program template delimiter (<<) is encountered, execution is suspended, and the subsequent lines are written (after macro substitutions) to the current output. This process ends when a closing program template delimiter (>>) is encountered alone on a line.

See Also

$ (Template line join)

Program Templates and the GENERATE Command

SET INPUT TIMEOUT

Controls how long a FORM or MENU INPUT command waits for user interaction.

Syntax

SET INPUT TIMEOUT [num]

Parameters

num        The number of seconds to wait for user input. Can be
an integer constant (e.g., 15, 200);
a variable, form field, or parameter that evaluates to an integer.
Valid values for num range from -1 to 32000. Specifying a value of -1 instructs the software to wait indefinitely for user interaction.

Comments

The INPUT TIMEOUT option is set to -1 by default, instructing the software to wait indefinitely for user interaction after an input request.

If user interaction does not occur before the timeout period expires, the input request terminates and program execution resumes at the next command.

When a timeout period expires, the following system variables are affected:

  • Event.EventName is assigned the value “Timeout”
  • Event.EventType is assigned the value “System”

Note that the SET INPUT TIMEOUT value is not restored on a SET RESTORE.

See Also

FORM INPUT

MENU INPUT

SET TIMEOUT

DDEPoke

DDEPoke

Assigns a value to a specific item in a remote application.

Syntax

procedure DDEPoke (out tErrCode, inout tServ,
 in dde_item, in dde_val)

Parameters

tErrCode

longint, an error code

tServ

longint, connection handle

dde_item

char, item name

dde_val

char, value of the item

Comments

DDEPoke assigns a value to a specific item in a remote application. Consult the documentation of the remote application for information on what constitutes an item. The value of an item is always given as char.

The filename is ddepoke.pgm.

Example

For example, given that DDE_Err and hServ are of type longint, to set the value of row 1, column 1 in the current spreadsheet, enter the following:

DDEPoke (DDE_Err, hServ, ‘R1C1′, ’25’)

This example “pokes” the value ’25’ into row 1, column 1.

en_CAEnglish