LIST

Lists data from the database.

Syntax

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

Parameters

num

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

setspec

A set specification whose members are to be listed. If setspec is omitted, the current set (if available) is used.

expression

Any 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:

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) heading "Age of Employee"

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.

 

Related Topics