HELP

Presents online help information.

Syntax

HELP [topic]

Parameters

For files that invoke the winhelp executable

topicA character string or a number, or an expression that evaluates to a character string or a number. Identifies a particular help topic in the help file.
If topic is a character string, the HELP command accesses the help file with topic as a keyword. If topic contains the pattern-matching wildcard character “%”, HELP uses the prefix of topic, up to the first “%” as the keyword. A partial key match is done, and matching keywords are displayed in a search window.
If topic is a number, it is assumed to represent a “context ID”. HELP accesses the help file using topic as the “context ID”.
If the keyword or “context ID” provided by topic is invalid, a warning message is displayed, followed by the help topic search window.
If topic is blank or $Null, HELP shows the first topic in the help file.

Note: For Explorer-style hypertext Help files, topic is a character string or a number, or an expression that evaluates to a character string or a number which identifies a particular help topic in the help file. It invokes the name of one of the .html files that were used to build the . chm file.

Comments

The HELP command displays online help about a given topic. By default, the command accesses the help file, ZDL.CHM, in the directory containing the software. To use another help file, set the system variable $ HelpFile to the name of the desired help file.

In the Windows environment, the HELP command determines, based on the extension of the help file, whether to invoke the Internet Explorer’s hypertext help viewer ( hh.exe) or to invoke the Windows help driver ( winhelp.exe) to display the help topics.

Winhelp help files

If the help topic is specified as a character string, the HELP command passes the string to the help driver as a keyword. If an exact match is not found, the help driver displays a warning message, following the topic search window.

If the character string contains the pattern-matching wildcard character $, HELP passes the string to the help driver, up to the first $ character, as a keyword prefix. Keywords that match the prefix are displayed in a topic search window for selection.

If the help topic is specified as a number (any numeric data type), HELP passes the number to the help driver as a topic identifier. If the identifier is invalid, the help driver displays a warning message, followed by the topic search window.

If no help file can be found, the software raises an error.

Hypertext help files

The hypertext help viewer accepts only strings as topic names and they must match the html files that were used to build the . chm file.

See Also

$HelpFile

PROCEDURE

Starts and defines a procedure.

Syntax

PROCEDURE procname ([IN|OUT|INOUT] parm) [LOCAL (var)]

Parameters

procname

A valid object name. Procname must be the name of the existing application document that contains this procedure and must not conflict with a system keyword.

IN, OUT, or INOUT

Designates the direction in which the associated parm passes a value: Into the procedure (IN), out of the procedure (OUT), or both (INOUT).
If omitted, IN is assumed.

parm

The name of a parameter (a type of variable used only to carry values into and out of procedures). When more than one parameter is specified, they are separated from one another by commas.
If no parameters are defined, the enclosing parentheses must still appear.
A corresponding expression for each parameter is provided in the call to the procedure.

var

The name of the local variable whose use is restricted to within the local procedure. Local variables must be separated from one another by commas.

Comments

PROCEDURE declares the start of a procedure program. (A procedure program can have many local procedures, but only one main procedure.)

The call to the procedure must contain a corresponding expression for each parameter. The order of the expressions in the call must match the order of the parameters in the procedure declaration. If the number of expressions in the call differs from the number of declared parameters, then the call is ignored. Within the procedure, formal parameters are treated as if they were variables.

A PROCEDURE command must always have a corresponding ENDPROCEDURE command that marks the end of the procedure.

The number of formal parameters, plus the number of local variables, must not exceed the maximum parameters entry in the configuration file. The parameter size entry in the configuration file determines the maximum size of each formal parameter and local variable.

Example

procedure MyProc (item1, in item2, out item3, inout item 4)

Item1 and item2 are formal IN parameters, item3 is a formal OUT parameter, and item4 is a formal INOUT parameter.

procedure Summarize (DeptName, out AvgSalary) local (WorkVar)

WorkVar is a local variable (known only to procedure Summarize).

 

See Also

LOCALPROCEDURE

LOCALPROCEDURE

Defines and marks the start of a local procedure within an application program.

Syntax

LOCALPROCEDURE procname> ([IN|OUT|INOUT] parm)[LOCAL(var)]

Parameters

procname

 

A valid object name. The name of the local procedure cannot conflict with a software keyword. When a local procedure name conflicts with a pre-defined object name, the local procedure name takes precedence, provided the software is currently operating within the program that contains the local procedure.

 

IN, OUT, or INOUT

 

Designates the direction in which the associated parm passes a value: into the procedure (IN), out of the procedure (OUT), or both (INOUT).
If omitted, IN is assumed.

 

parm

 

The name of a parameter (a type of variable used only to carry values into and out of procedures). When more than one parameter is specified, they are separated from one another by commas.
If no parameters are defined, the enclosing parentheses must still appear.
A corresponding expression for each parameter is provided in the call to the local procedure.

 

var

 

The name of the local variable whose use is restricted to within the local procedure. Local variables must be separated from one another by commas.

 

Comments

The body of a local procedure is a sequence of commands. A LOCALPROCEDURE must always end with a corresponding ENDPROCEDURE command.

Local procedure declarations must appear at the beginning of their application program document, before the main procedure or before the commands of a macro program. A local procedure cannot be nested within the body of another procedure or local procedure. Local procedures obey all the same call/return rules as standard procedures, and possess the same capabilities as a standard procedure.

A local procedure can call other procedures in the same application program document or in other program documents. However, a local procedure can be called only by other procedures defined in the same program document.

Example

localprocedure LocalProc1 ()

 transform LocalProc2 ()

endprocedure

%——————————————-

localprocedure LocalProc2 ()

 output “Hi from LocalProc2”

endprocedure

%——————————————-

procedure MainProc (Param1, Param2)

  LocalProc1 ()

  LocalProc2 ()

endprocedure

The main procedure calls two local procedures. The first local procedure transfers control to the second through a TRANSFORM command.

 

See Also

ENDPROCEDURE

PROCEDURE

COLUMN BREAK

Breaks the body of column-oriented reports into summary groups.

Syntax

COLUMN BREAK level [HEADING reportitem [:format:]]

[FOOTING reportitem [:format:]]

Parameters

levelThe break level number (an integer greater than or equal to zero).
In the hierarchy of breaks, the higher the level number, the more minor the break. (For example, a level 1 break also triggers breaks at level 2, level 3, and so on.)
HEADINGIntroduces the “heading clause” for the break level, which can consist of a break orientation statement, a number of report items and their format instructions, or both. The footing displays each time the break level is triggered.
FOOTINGIntroduces the “footing clause” for the break level, which can consist of a break orientation statement, a number of report items and their format instructions, or both. The heading displays each time the break level is triggered.
reportitemAny valid expression that yields a value for display in the break heading or break footing. The heading and footing can each display a series of reportitems. Each item has its own associated format.
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 COLUMN BREAK command breaks the body of a column-oriented report into summary groupings.

Each time a BREAK command triggers a break at a specified level, the COLUMN BREAK for that level and all levels lower in the hierarchy are triggered.

Report items in the COLUMN BREAK heading can include individual values from the first member of the current group. Report items in the COLUMN BREAK footing can include individual values only from the last member of the current group. However, summary data computed over all members of the group can be displayed in the footing. Use aggregate functions.

If both the heading and footing clauses are omitted, a column break at the indicated level causes report formatting to recommence at the left-hand side of the page, beneath any previously formatted columns.

See Also

DETAIL LINE

ENDREPORT

REPORT FOOTING

REPORT FROM

REPORT HEADING

CASE

Enables conditional execution of commands.

Syntax

CASE

WHEN expression

commands1

[OTHERWISE

commands2]

ENDCASE

Parameters

expressionA logical expression (using conditional or Boolean operators).
commands1Commands that are executed if expression is logically true.
commands2Commands that are executed if expression is logically false.

Comments

A CASE command must always have a corresponding ENDCASE. Any number of WHEN clauses can appear between CASE and ENDCASE.

The WHEN phrases between CASE and ENDCASE are evaluated in order. Execution control transfers to the commands associated with the first WHEN clause whose expression is determined to be logically true. If none of the WHEN phrases contain an expression that evaluates to “true”, the commands associated with OTHERWISE (if used) are executed. Execution then resumes at the first command following ENDCASE.

If a WHEN expression includes fields from the current set, then the expression uses the values found in the current member of the current set.

If a BYE, RETURN, STOP, or TRANSFORM command exits a procedure in the middle of a CASE structure, the “open” CASE command is automatically closed. Also, if the end of the current procedure is reached before a necessary ENDCASE is encountered, the “open” CASE command is closed.

If the ENDCASE is missing, all subsequent commands in the current procedure are treated as part of the CASE structure.

Example

If the value for salary is neither less than 20,000, nor between 20,00 and 30,000, the first and second set of commands are skipped, and the third set of commands executed.

case

when salary < 20000

… first set of commands …

when Salary between 20000 and 20000

… second set of commands …

otherwise

… third set of commands …

endcase

The following program fragment illustrates how WHEN conditions in a CASE command can handle an application user’s choice of accelerator keys in an application. Depending on the key pressed by the application user, a particular procedure is executed.

form display input

case

when Event.EventName = “F3”

return

when Event.EventName = “F1”

AddNewRecord ()

when Event.EventName = “F2”

ChangeRecord ()

when Event.EventName = “F4”

DeleteRecord()

otherwise

GiveHelp ()

endcase

FIND

Finds records that match specified conditions, producing a result set.

Syntax

FIND [ num] [ setspec] [EVALUATE clause] [-> clause]

Parameters

numThe number of records to be found. Num can be
an integer constant (15, 200);
a variable, form field, or parameter that evaluates to an integer;
the word ALL.
If num is omitted, or less than 0, it defaults to ALL.
setspecThe set specification that defines the records to be found. If omitted, the current set (if it exists) is used.

Comments

Sets found using the FIND command are not stored permanently; they exist only for the current application session or until a DISPOSE SET command is executed.
If the -> clause is omitted, a result set is still produced. The unnamed result set can be referred to as CurrentSet for as long as it remains the current set.
Changes made to a record in an EntitySet or relationship are reflected in the result set, and vice versa.
$ SetCount and $ MemberCount are assigned a value equal to the number of members in the result set found by the FIND command.

Example

To find all employees whose last name is Smith, enter

find all Employees where LastName = “Smith” -> SmithSet

If you are working interactively at the command prompt, you could find it convenient to use the current unnamed result set when narrowing down a set of records. In the repeated FIND command, the second and third commands use the current set as their implicit setpsec:

> find Employees where Location = “Canada”

2019 selected

> find where LastName = “S”?

146 selected

> find where DeptNum = “D01”

7 selected

The name CurrentSet can also be used explicitly.
In application programs, you should explicitly name the result sets that you create with a FIND command. This technique is especially useful if you plan to compile a program that contains FIND commands:

procedure GetSet1 (a, b)

if a=b

find all Employees WorkIn Department -> KeepEmps

else

find all Employees WorkIn Department where LastName = a -> KeepEmps

endif

list all KeepEmps

endprocedure

You can use the FIND command to locate data, as shown in the following example:

find all Employees where LName = fEmployees.LastName

if $ setcount > 0

list all

else

  output “Nobody who works here is named: ” fEmployees.LastName

endif

You can also use FIND with forms as shown below:

find fItems where fItems.Qty > 0  % find values entered

See Also

$MemberCount

$SetCount

COMPUTE

INTERSECT

MINUS

UNION

PERMISSION

Grants permission to other users to access your data.

Syntax #1

Sets permission for access to EntitySets or relationships.

PERMISSION object who [READ] [ADD] [CHANGE] [DELETE]

Parameters

objectSpecifies the name of an EntitySet or relationship.
whoIdentifies the users to whom the specified object permissions apply; who can be
OWNER
Anyone who shares the UserID under which object was created.
GROUP
Anyone who shares the GroupID under which object was created.
OTHER
Everyone else.
READGives the designated users permission to read the contents of object.
ADDGives the designated users permission to add to the contents of object (implies READ).
CHANGEGives the designated users permission to change the contents of object (implies READ).
DELETEGives the designated users permission to delete the contents of object (implies READ).

Syntax #2

Sets permission for access to fields or application directories.

PERMISSION object who [READ] [UPDATE]

Parameters

objectSpecifies the fully qualified name of an application directory of field.
whoIdentifies the users to whom the specified object permissions apply; who can be
OWNER
Anyone who shares the UserID under which object was created.
GROUP
Anyone who shares the GroupID under which object was created.
OTHER
Everyone else.
READGives the designated users permission to read the contents of object.
UPDATEGives the designated users permission to update the contents of object.

Comments

Only the owner of an object can reset that object’s permissions.

To access a directory, you must have READ or UPDATE permission. To CREATE, ERASE, or RENAME objects in a directory, you must have UPDATE permission. By default, all users have UPDATE permission in a directory.

Example

permission Employees owner add change

Gives only add or change permission to the owner.

permission Employees other

Gives no access by users outside the owner’s group.

permission Employees.LastName group read update

Users in owner’s group can read but not update.

permission MyDir group update

permission MyDir other

Users in the owner’s group can read the MyDir directory and can create, erase, or rename objects in it. Other users are to have no access to MyDir.

See Also

object permissions

WHILE

Enables repeated execution of a block of command.

Syntax

WHILE [expression]

commands

ENDWHILE

Parameters

expressionA logic expression.
If expression includes fields from the current set, then it is evaluated using the values of the specified fields in the current member of the set.
ENDWHILEMarks the end of the WHILE structure. A WHILE command must always have a corresponding ENDWHILE.
If a necessary ENDWHILE is missing, all subsequent commands in the current procedure are treated as part of the WHILE structure, and all of those commands continue to be executed as long as expression is true. When the end of the procedure is reached, the “open” WHILE command is closed.

Comments

The WHILE … ENDWHILE structure enables a block of commands to be repeatedly executed, as long as expression is logically true.

As soon as the software detects that expression is logically false, execution resumes at the first command following the ENDWHILE. To exit a loop before expression evaluates to false, use a BREAK command.

An open WHILE loop is automatically closed if

  • you exit a procedure in the middle of a WHILE structure (using a BYE, RETURN, STOP, or TRANSFORM command), or
  • a procedure ends before the ENDWHILE is encountered.

Example

% Commands to select and display form fDispEmp

%

——————————————————————-

find all Employees       % Create set of all Employees

while $setcount > 0      % Loop until end of set

  change fDispEmp from current  % Fill form with emp. data

  form display nolabel input    % Display form and start input

  if Event.EventName = “Escape”  % Check for Escape key

  return           % If so, finish

  endif

  if ThisForm.FormChanged = $true % Check if data modified

  change current from fDispEmp % Update current member

  endif

  next            % Go to next record

  let $setcount = $setcount – 1   % Decrement $setcount

endwhile

while Age > 20

 … other commands …

% Missing endwhile statement

… more commands …

last command in procedure

In the preceding example, the commands subsequent to the missing ENDWHILE command are executed as if they were a part of the WHILE structure. When the end of the procedure is reached without encountering the necessary ENDWHILE, it generates an error message.

form open fCustomers

while

 form display input

 … more commands …

 if Event.EventName = “Escape”

  break

 endif

…more commands …

endwhile

Notice in the preceding command that a BREAK (or BYE, RETURN, STOP, or TRANSFORM) command is required to exit a WHILE loop that contains no logic expression.

See Also

Boolean Expressions

Conditional Expressions

CONTINUE

LIST

Lists data from the database.

Syntax

LIST [ num] [ setspec] [EVALUATE clause ] [FORMAT expression [HEADING expression]] [-> clause]

Parameters

numThe number of records to be listed. Num can be
an integer constant (e.g., 15, 200);
a variable, form field, menu item, or formal parameter that evaluates to an integer;
the word ALL.
If num is less than zero, or omitted, num defaults to 1.
setspecA set specification whose members are to be listed. If setspec is omitted, the current set (if available) is used.
expressionAny expression. Enclose complex expressions in parentheses.
heading

A character string or an expression that evaluates to a character string.

Comments

The LIST command outputs num members of source to the current output device (usually the terminal).

By default, each column has a heading consisting of the field name. Headings can be suppressed using the SET HEADINGS command.

The width of each column is determined by these rules:

  • Unless a “LIST width” has been defined, character values occupy a width equal to their defined object length.
  • Unless a “LIST width” has been defined, number values are converted to their character equivalents, using the maximum width required for the particular data type (e.g., INT converts to eight characters).
  • If defined, the “LIST width” determines the width of a column (if 0 or $Null, the implicit width is used; if -1, the field is not LISTed).
  • If headings are to be output, widths are appropriately extended for longer headings.
  • If a character-manipulating function reduces the length of values being output, the output width is not reduced.
  • The $toalpha and $tocharacter functions can be used to specify the width of a column in LISTed output.

The HEADING option, always used in conjunction with FORMAT, establishes the heading that will be displayed above the corresponding expression, in place of any other heading that ZIM otherwise would be displaying. This option particularly useful whenever the expression is not a single field, thus normally not displaying any headings.

Output is also controlled by the SET PAGESIZE, SET PAGEWIDTH, and SET PAUSE commands.

Example

list all Employees format LName FName (($date – BirthDate)/365)

The complex expression is enclosed in parentheses.

list all Employees format LName heading “LastName” FName(($date-BirthDate)/365)

It will list three fields whose headings are: “Last Name”, “FName” and “Age of Employee”.

list

The current member of the current set is listed.

list all format $count(“”) LName FName Age

All members of the current set are listed with sequence numbers.

See Also

OUTPUT

REPORT FROM

SELECT

SET PAGESIZE

SET PAGEWIDTH

SET PAUSE

DEPENDENCY

Produces or deletes object dependency information.

Syntax

DEPENDENCY [RESET] [FOR] [object]

Parameters

RESET

Instructs the software to delete all saved dependency information for the specified object(s). If no object is named, all dependency information is deleted.

object

The name of an object for which you want to output dependency information, or whose dependency information you want to delete.

Comments

Object dependency information is captured during ERASE, CREATE, COMPILE, and PARSE commands if a SET DEPENDENCY ON command has been issued. The DEPENDENCY command either deletes this information or sends it to the current output. When dependency information is output, each dependency occupies one line and the output contains the following fields:

Flags

The first character can be
S if the dependency is for a system-defined object.
P if the dependency results from a reference by an application program.
O in all other cases (the dependency is an owner-object).
The second character can be
X if the dependent object is more recent than the time of program compilation (for a program dependency) or the time of creation of the owner-object (for an owner dependency).

ObjectName

The name of object (whose dependent objects are being displayed).

ObjectType

The object type of ObjectName

ObjectDirName

The application directory location of OwnerObjectName.

OwnerObjectName

The name of the object that owns object (i.e., if object is a field, then OwnerObjectName is the name of the EntitySet, relationship, or application document that owns that field).

OwnerObjectType

The object type of OwnerObjectName.

OwnerObjectDirName

The application directory location of OwnerObjectName.

DepObjectName

The name of an object that depends on ObjectName.

DepObjectType

The object type of DepOwnerObjName.

DepObjectDirName

The application directory location of DepObjectName.

DepOwnerObjName

The object name of  DepObjectName.

DepOwnerObjType

The object type of DepObjectName.

DepOwnerObjDirName

The application directory location of DepOwnerObjName.

Example

Consider a one-line application document called Test:

list e1

To produce dependency information for Test, enter

> set dependency on      % on by default

> parse TestProg

> dependency for TestProg

that outputs

O Test Document ZIM ZIM Directory ZIM

P Test Document ZIM ZIM Directory ZIM e1 EntitySet ZIM ZIM Directory ZIM

 

See Also

$compilestatus

COMPILE

PARSE

SET DEPENDENCY

SET OUTPUT

SET XREF

 

pt_BRPortuguese