SET EXECUTEMODE

SET EXECUTEMODE

Controls the mode of software execution.

Syntax

SET EXECUTEMODE SQLMODE | ZIMMODE | SERVERMODE

Comments

The EXECUTEMODE option is set to SQLMODE by default.

The SQLMODE option executes SQL database code.

The SERVERMODE option executes integrated Zim server code.

The ZIMMODE option executes standard Zim code. In ZIMMODE, EntType, RelType, and so on are ignored. In this way, it can be used for testing without an effective connection.

When EXECUTEMODE is SQLMODE, Zim executes integrated server requests on the target Zim server if possible. Otherwise, it sends SQL requests to the server. When EXECUTEMODE is SQLMODE, Zim executes code against the target SQL database. By setting EXECUTEMODE to ZIMMODE, Zim executes the code as standard Zim code.

Example

To execute Zim Client-server code as standard Zim code, enter

> set executemode zimmode

See Also

COMPILE

SET COMPILEMODE

SET SQLCOMPILE

UNCOMPILE

SET STOP ERRORS

Halts the execution of an application program if an error occurs.

Syntax

SET STOP ERRORS ON|OFF

Comments

The STOP ERRORS option is OFF by default.

When STOP ERRORS is switched ON, execution is halted (by the HALT utility) when an error occurs. To resume execution after the HALT, press Enter at the HALT prompt (>>).

Compiled application programs are not affected by SET STOP ERRORS.

The ET STOP ERRORS command is not affected by the SET RESET and SET RESTORE commands.

Example

> set stop errors on
:
> list all test
procedure test (p_OwnerName)
report from Fields where OwnerName = p_OwnerName % Spelling error
… body of report …
endreport
endprocedure
> test
*** Error *** …
>>

The HALT command is executed when the execution of test results in an error. (The name of the EntitySet Fields is misspelled in the body of the procedure.)

See Also

$ErrCode

SET SELECTIVITY

SET SINGLESTEP

SET MEMBERINTERVAL

Sets the interval between set-processing progress messages.

Syntax

SET MEMBERINTERVAL num

Parameters

numNum can be:
an integer constant (e.g., 15, 200)
a variable, form field, menu item, or parameter that evaluates to an integer.

Comments

The MEMBERINTERVAL option is set to 1 by default.

The MEMBERINTERVAL option determines how many records are to be processed between messages tracking the progress of set-processing commands. Set-processing progress messages are turned on or off with the SET MEMBERCOUNT command.

Example

> set membercount on
> set member interval 10
> find Employees
200 processed.
200 selected.
>

The number of records processed and selected are displayed in increments of ten until all records are processed.

See Also

$MemberCount

SET ERRORS

SET MEMBERCOUNT

SET PAGESIZE

Controls the overall length of pages output by the LIST command.

Syntax

SET PAGESIZE num

Parameters

numNum specifies, in lines, the height of an output page.
Num can be:
an integer constant (e.g., 15, 200);
a variable, form field, menu item, or parameter that evaluates to an integer.

Comments

The PAGESIZE option is set to 24 lines by default.

The PAGESIZE option should be adjusted to suit the current output device (e.g., 66 lines for a printer, 24 lines for a terminal screen).

Example

set output printer
set pause on
set pagesize 40
set pagewidth 120
list all Employees sorted by Department

Here, the SET PAGESIZE command (together with SET PAGEWIDTH) sets LIST output for printing in the landscape orientation.

See Also

LIST

SET HEADINGS

SET PAGEWIDTH

SET PAUSE

SET PAGEWIDTH

Controls the overall width of pages output by the LIST command.

Syntax

SET PAGEWIDTH num

Parameters

numNum specifies, in characters, the width of an output page.
Num can be
an integer constant (e.g., 15, 200).
a variable, form field, menu item, or parameter that evaluates to an integer.

Comments

The PAGEWIDTH option is set to 80 characters by default.
If the data generated by LIST or SELECT exceeds the current PAGEWIDTH, the software assumes that the output device wraps data onto subsequent lines.

Example

set output printer

set pause on

set pagesize 40

set pagewidth 120

list all Employees sorted by Department

Here, the SET PAGEWIDTH command (together with SET PAGESIZE) sets LIST output for printing in the landscape orientation.

See Also

SET HEADINGS

SET PAUSE

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

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

SET TEXTDELIMITER

Specifies the current text delimiter for comma-delimited format.

Syntax

SET TEXTDELIMITER character

Parameters

character

Any valid character, or a variable containing a valid character. Reserved characters (e.g., space, backslash, etc.) must be enclosed in quotation marks.

Comments

The TEXTDELIMITER option is set to the double quotation mark (“) by default.

The specified character is used as the delimiter, marking the boundaries of character-type fields in the comma-delimited format. The delimiter is used by the INPUT command (input from the terminal), by the ADD and CHANGE commands (input from an unstructured application document), and by the LIST and OUTPUT commands (output to the terminal or an unstructured application document) in COMMADELIMITED format.

If TEXTDELIMITER is set to the space character, the double quotation mark is used as the text delimiter for both input and output.

Example

set textdelimiter “/”

 

See Also

ADD

CHANGE

INPUT

LIST

OUTPUT

SET DELIMITER

SET INPUT FORMAT

SET OUTPUT FORMAT

SET SPECIALSCAN

SET SEQUENCENUMBER

Controls the way Automatic Sequence Numbers operate.

Syntax

SET SEQUENCENUMBER {object | ALL} {number | variable | ON | OFF}.

where

object

The name of an Entity-Set Relationship with fields that contains an ASN defined

ALL

Refer to all Entity-Sets and Relationships with fields that contain ASNs defined

number

a positive number from 1 up to 15-digit number

variable

a variable containing a positive number from 1 up to a 15-digit number. If the contents of the variable is $null, the number is assumed to be 1.

Comments

The command sets an initial number, enables or disables automatic sequential numbers to the mentioned object or to ALL the objects that contain ASN.

Examples

SET SEQUENCENUMBER ALL 1

Resets all existing ASN to 1.

LET MyVar = 1000
SET SEQUENCENUMBER Customer MyVar

Initializes the ASN for Customer to the value of 1000.

SET SEQUENCENUMBER ALL OFF

Disables all ASN.

SET SEQUENCENUMBER Customer ON

Enables the ASN for the Customer object and $ZimSeqNum returns the current sequence number available for Customer

SET OUTPUT

Specifies the current output.

Syntax

SET OUTPUT docname [APPEND] [FILEPATH options]

Parameters

docnameThe name of the application document to which all output is to be sent. Can also be one of the two pre-defined application documents, terminal or printer.
APPENDSpecifies that new output to docname is to be appended to the output already existing in the application document (if any).
FILEPATH optionsSpecifies that the input document will be governed by the options as follows:

file://<the full path of a text file> – subsequent ZIM statements referring to the docname above will read this physical file instead;

port://name:speed:bits:parity:stopbits:CTS – It only works for Linux environments and specifies a serial port to be read;

connector://IP address:port – reads from the specified IP address (or URL) using that port number;

pipe://<OS command> – executes the OS command.

fifo://<FIFO name> – reads records from the FIFO name.

Comments

The SET OUTPUT command specifies the application document that is to receive the output from all subsequent FORM REPORT, GENERATE, LIST, OUTPUT, PRINT, REPORT FROM, and SELECT commands. The setting remains in effect until changed by a subsequent SET OUTPUT command.

The software provides two pre-defined application documents, terminal and printer, that correspond to your terminal screen and default printer, respectively. OUTPUT is set to Terminal by default. If set to printer, the SET OUTPUT command has no impact on the format in which the report prints; use $setproperty to change print properties for a report.

The APPEND option is not valid in combination with the option FILEPATH.

The FILEPATH “file:…” is an excelent way of providing an output file without creating a new document.

The FILEPATH “pipe:…” allows to execute any operating system command without creating a specific document for it.

The FILEPATH “fifo:…” writes records to a FIFO (in memory) for subsequent read by another Zim program using SET INPUT FILEPATH “fifo…”. Many programs (producers) can write to a FIFO, but usually only one (consumer) reads from it.

Example

set output MyDoc append
set output printer
report from ...
... other commands ...
endreport
set output terminal

This example shows how to write a document anywhere in the system. The first SET OUTPUT sets the output to “c:\myDir\FirstFile.txt” while the second sets it to “c:\myDir\SecondFile.txt”.

set output MyDoc filepath "file://c:\\myDir\\FirstFile.txt"
list 20 zimprof
set output MyDoc filepath "file://c:\\myDir\\SecondFile.txt"
list all AnotherDoc
set output terminal

See more examples in the command SET INPUT.

pt_BRPortuguese