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

numThe 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.

GOTO PREVIOUS

Branches from an exception handler to the command that caused the exception.

Syntax

GOTO PREVIOUS

Comments

GOTO PREVIOUS is used only in an exception handler and only to branch to the command that caused the exception to occur. GOTO PREVIOUS exits the exception handler, and closes it in the same way as ENDON.

Example

Note: In this example, all transactions are assumed to be implicit transactions (i.e., single commands).

procedure UpdateDB()

 on deadlock

  output “The database is busy.”

   output “Do you want to try again? ( y/ n):” ;

   input Response

  if Response = ” y”

goto previous

  else

   return

  endif

 endon

 … the rest of the commands in the procedure …

endprocedure

If a deadlock condition occurs, the exception handler asks the application user if the transaction should be attempted again. If the answer is yes, the GOTO PREVIOUS command causes the application program to retry the command that caused the deadlock condition. If the answer is no, the procedure terminates.

See Also

GOTO

GOTO NEXT

ON

SET INPUT FORMAT

Establishes the format for data input.

Syntax

SET INPUT FORMAT NORMAL|COMMADELIMITED

Comments

The INPUT FORMAT option is NORMAL by default.

Normally, the ADD and CHANGE commands look for input whose format is a simple data stream, separated by delimiter characters. SET INPUT FORMAT enables these commands to read data in “comma delimited” format from unstructured application documents.

When using the comma-delimited format, data base fields are separated from one another by the delimiter character. This is normally a comma, but it can be changed using the SET DELIMITER command. Character-type fields have trailing blanks removed and are enclosed by the text delimiter. This is normally double quotation marks, but can be changed using the SET TEXTDELIMITER command. Numeric fields have leading blanks removed.

Fields that match the current NULLVALUE string (without text delimiters) are evaluated as $Null. Fields comprising of two text delimiters are evaluated as $Null or zero, depending on the field being assigned.

Example

set save
set input format commadelimited
set nullvalue “$null”
add Customers from UnstructuredDoc
set restore

See Also

ADD

SET DELIMITER

SET NULLVALUE

SET OUTPUT FORMAT

SET TEXTDELIMITER

PAGE FOOTING

Specifies the page footing for a report.

Syntax

PAGE FOOTING 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 FOOTING command causes a footing to be displayed at the bottom of every page of a report. Report items in this command can include individual data values only from the last record processed on the current report page; however, summary information computed over all the members on the current report page can be displayed in the footing.

See Also

BREAK (Reports)

How to Use The Report Generator

PAGE HEADING

REPORT FOOTING

Report Item Format Options

pt_BRPortuguese