HALT

In application programs, sets break points where execution is to be halted.

Syntax

HALT

Comments

The HALT command suspends execution of the currently executing application program and displays the HALT prompt (>>) at the terminal. You can then enter any command, including a call to another program.

The SET SINGLESTEP ON command causes the HALT command to be automatically executed after each command in the currently executing program.

If executed at the HALT prompt, BYE, RETURN, STOP, and global SET commands act in the usual manner. Local SET commands (e.g., LEXTRACE, RUNTIME, FLOW) is applied to the suspended program when it resumes.

If desired, you can redefine HALT to perform any useful function.

To re-define HALT, first ERASE the HALT program. Next, change the definition of HALT in the Documents EntitySet: make HALT correspond to a disk file called HALT.DOC. CREATE HALT again, ensuring that HALT.DOC contains the commands to perform the desired function.

For example, if you wanted to track memory use, HALT.DOC can contain the line:

system ” chkdsk”

% this command shows memory use

If you were to issue the command SET SINGLESTEP ON, the new version of HALT would be executed after every command, giving you a continuous record of disk and memory use.

Example

halt  % at >> prompt, you can turn on tracing,

   % output variables, etc.

 

< > (Macro name delimiters)

Marks the start and end of a macro name in an application program.

Syntax

<name>

Parameters

nameThe name to be assigned to a global macro, or a digit from 0 to 9 referring to one of the local macros belonging to the current macro program.

Comments

A macro is a dynamically declared name that represents a character string. When a macro call is encountered in an application program, the macro call is replaced by the current character value of the macro.

A macro acquires values in one of two ways: implicitly, when the software encounters a call to a previously unknown global macro or unassigned local macro, or explicitly, in a LET or INPUT statement or a call to a local macro.

Example

let <EntSet> = "ENTS"
let <Name> = "EntName"

Defines the global macro to represent the string ENT. Then the statement

list #<EntSet> format #<Name>

is interpreted as

list ENTs format EntName

See Also

Conventions

How To Construct Logic Expressions

How To Use Logic Expressions

[NOT] LIKE

Matches an expression to a pattern.

Syntax

expression [NOT] LIKE pattern

Parameters

expressionAn expression that evaluates to a character string.
patternAn expression that evaluates to a character string. Pattern must consist of combinations of letters, digits, symbols, and the special wildcard characters % and _.

Return Value

Logical.

Comments

A LIKE comparison is logically true if expression matches patterns.

A NOT LIKE comparison is logically true if expression fails to match pattern.

Example

compute Employees where LastName like "_a%n"

Processes all records whose LastName values are three characters or more, the second character being an a, and the last character being an n.

find Parts where PartNo like "_ _\_%"

Finds all parts whose part numbers have an underscore as the third character.

find Parts where PartDesc like "%\\%"

Finds parts whose part description contains a backslash.

See Also

About Conditional Expressions

SET SIZE

Sets the estimated number of records in an EntitySet, relationship, application document, or result set.

Syntax #1

SET SIZE object size

or

SET object SIZE size

Parameters

object

The name of an EntitySet, a relationship with fields, a structured application document, or a result set.

size

A positive number representing the estimated number of records in object.
A size of 0 instructs the software to use an internal default value for the size of object.

Comments

The SET SIZE command supplies the strategy analyzer with your estimate of the number of records in object. SET SIZE has no effect on the AvgSize field associated with object in the Object Dictionary.

The SET SIZE command is not affected by the SET RESET and SET RESTORE commands.

Example

To set the estimated number of records in the EntitySet Employees to 5000, use

set size Employees 5000

 

See Also

SET SELECTIVITY

$addseconds

Calculates a time value by adding seconds to (or subtracting seconds from) a specified time value.

Syntax

$addseconds(time,number)

Parameters

timean 8-digit number, or an expression that evaluates to an 8-digit number, that expresses a valid time value in the format HHMMSSTT
numbera number, or an expression that evaluates to a number

Return Value

Number, representing a time value.

Comments

Use $addseconds to perform arithmetic with time values. The $addseconds function calculates a time value by adding a number representing seconds to a time value. If number is negative, the effect is to subtract the seconds from the time.

Example

If $Time has the value 22503075, then

$addseconds($time,5)

evaluates to 22503575.

$addseconds($time,35)

evaluates to 22510575.

$addseconds($time,-5)

evaluates to 22502575.

$addseconds($time,65)

evaluates to 22513575.

$addseconds(22595900,1)

evaluates to 23000000.

See Also

$addhours
$addminutes
$addticks
$seconds

$count

Counts the number of set members that meet a specified condition, excluding records in which the condition is $Null.

Syntax

$count(expression)

Parameters

expressionis any expression

Return Value

Number, with no decimal places.

Comments

Expression is often a WHERE expression that includes only selected set members in the counting operation. If the WHERE expression (expr1 WHERE expr2) is true, then the member containing expr1 is included in the running count; otherwise, expression is considered $Null and is not included in the running count.

Example

compute Employees where DeptName="Sales" 
  evaluate (let EmpsInSales = $count(LastName where LastName = "Smith"))

First finds all employees in the sales department, then counts the number of Smiths among those employees.

add Employees from TestData let EmpNum = ($count("")+1000)

As employee data is added, each new record is counted. New employee records are assigned unique employee numbers in sequence, based on the current value of $count plus 1000.

See Also

$average

$max

$min

$total

About Character Literals

About Functional Expressions

WHERE

GRAPH

Starts a graphics program.

Syntax

GRAPH expression [ RESET|CLOSE] [INVISIBLE] [BACKGROUND]

Parameters

expression

 

A character string, or expression that evaluates to a character string. The content of the string is passed to the graphics program call (e.g., parameters). If no parameters are required, specify the null string.

 

RESET

 

Flushes all internal data buffers to disk.

 

CLOSE

 

Flushes all internal data buffers to disk, and closes all files not currently in use.

 

INVISIBLE

 

Executes the graphics program without affecting the screen display.

 

BACKGROUND

 

Executes the graphics program asynchronously while Zim continues to run. You can continue working, and have a number of graphics sessions running concurrently.

 

Note: BACKGROUND is ignored in some operating environments.

Comments

The value of the system variable $Graphics identifies the graphics program to be run. If $Graphics has not been assigned a value, the default value is used.

When you exit a graphics program that was not run in the BACKGROUND, execution of your application program resumes following the call to the graphics program.

 

See Also

EDIT

SYSTEM

DDEPeek

DDEPeek

Syntax

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

Parameters

tErrCodelongint, an error code
tServlongint, connection handle
dde_itemchar, item name
dde_valchar, value of the returned item. Must be a string at least five characters in length

Comments

DDEPeek retrieves the value of a specific item from a remote application. Consult the documentation of the remote application for information on what constitutes an item. The value of an item is always returned as char.

The filename is ddepeek.pgm.

Example

For example, given that DDE_Err and hServ are of type longint, that DDE_OutValue is of type alpha and is 10 characters long, and that hServ has been set in a previous call to DDEConnect, to retrieve the value of row 1, column 1 in the current spreadsheet, enter the following:

DDEPeek(DDE_Err, hServ, ‘R1C1’, DDE_OutValue)

This example “peeks” at the value of the cell at row 1, column 1 and places the retrieved value in DDE_OutValue.

$Null

A “null” value for comparison.

Syntax

$null

Value

“Null” (a state of valuelessness). Cannot be reset by an application program.

Description

The “null” property. $Null can be written without the dollar sign.

When certain atomic expressions (variable name, field name, form field name, or formal parameter name) are used before being assigned values, or if the values are unknown, those expressions are considered to be $Null.

$Null is a property indicating a state of valuelessness; $Null is not itself a value. The null string is a value and is therefore not the same as the $Null property.

An arithmetic or functional expression that includes a $Null argument or operand always evaluates to $Null.

A logic expression that includes a $Null operand always evaluates to $False.

Because $Null is not a value, you cannot use the conditional operators = (Equals) and <> (Not Equals) to determine if an expression is $Null. Instead, the operator IS [NOT] [$]NULL is used as shown in the following example:

Salary is $null
Salary is null
Salary is not $null
Salary is not null

Note: You can write $Null without the dollar sign.

Example

if Salary is $null
 let Salary = StartingSalary
 ... commands ...
endif

See Also

$False

$True

EDIT

Starts a text editor to edit an application document.

Syntax

EDIT docname [BACKGROUND]

Parameters

docname

The name of an application document.

BACKGROUND

Indicates that the editor is to be executed asynchronously while the application continues to run.

Comments

The value assigned to $Editor should be the full path and file name of the desired text editor.

With BACKGROUND omitted, the EDIT command causes execution to be suspended; the editor takes over. When you exit from the text editor, execution resumes from the point at which the EDIT command was encountered.

With BACKGROUND specified, the editor can be running in its own window while the application continues to execute. You can have concurrent editing sessions.

Note: Any return code that is generated by the editor is placed in the $ErrCode system variable.

BACKGROUND is ignored in some operating environments and when using Zim Thin Client.

Example

To start a text editor, edit.com, for editing MainProg, enter

let $Editor = “NotePad”

edit MainProg

that sets the $Editor system variable to the name of the desired edit program. It then calls up that program to edit the specified file.

 

See Also

$Editor

$ErrCode

GRAPH

SYSTEM

pt_BRPortuguese