$addminutes

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

Syntax

$addminutes(time,number)

where

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 $addminutes to perform arithmetic with time values. The $addminutes function calculates a time value by adding a number representing minutes to a time value. If number is negative, the effect is to subtract the minutes from the time.

Example

If $Time has the value 22503075, then

$addminutes($time,5)

Evaluates to 22553075.

$addminutes($time,10)

Evaluates to 23003075.

$addminutes($time,-5)

Evaluates to 22453075.

$addminutes($time,65)

Evaluates to 23553075.

ZIM Comment Block << >>

(Program template delimiters)

<< your code >>

Quickly marks a large block of code that you want to prevent from running or that you want to be generated by the GENERATE command by putting the delimiters at the start and end of an output section in a template program.

Syntax

Place a two less than characters before the start of the code.

<< 
code / statements

>>

Place a two greater than characters at the end of your code.

Parameters

code \ statements

 

one or more command statements, typically using macros, to send to the current output destination when the program containing them is processed with a GENERATE command

 

Comments

The program template delimiters, << and >>, must appear alone on a physical line in the application document. When the program is executed, parsed, or compiled, the statements between the delimiters are ignored.

When the program is run under the GENERATE command, the statements are sent as output, after macro substitution, to the current output device.

Example

… commands1 …
<<
… commands2 …
>>
… commands3 …

Under normal execution, commands1 and commands3 execute normally; commands2 are ignored.

When the program is parsed or compiled, commands1 and commands3 are parsed or complied in the usual manner; commands2 are ignored.

When the GENERATE command is used, commands1 and commands3 execute normally; commands2 are sent as output, after macro substitution, to the current output device.

$DeadlockReason

Indicates the reason that a deadlock condition occurred.

Syntax

$deadlockreason

Return Value

A character string. Cannot be reset by an application program.

Description

$DeadlockReason contains one of the following reason codes for the current deadlock condition:

CodeReason
0transaction completed normally
1transaction terminated due to time out
2transaction terminated due to transaction recovery
3not in use
4attempt to do an update in a read transaction
5transaction terminated as a result of deadlock
6lock request outside a transaction (warning only)
7problem converting operating system lock (transaction terminated)
8no free file table entry (transaction terminated)

See Also

SET DOCUMENT FORMAT

System Variables

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

pt_BRPortuguese