Dbgl

Command Lists

A command list is made up or one or more command lines.  Each command line consists of a command statement terminated by a semi-colon (;).

Command statements consist of either an assignment, control function or database function.

Assignment

Assignment to variables is done using the "=" operator, the syntax is:

<variable name> = expression

Expressions may be made up of mathematical or string functions combined with various operators.

reccordcnt = recordcnt+1

This increments a variable called recordcnt by one.

Control Functions

Control functions affect the flow of the script, there are three such functions available:

Stops the program execution.

STOP or HALT

STOP "End of projection">

Restart the definition or generation at the first statement

RESTART

Enable code tracing (displays each line as it executes)

TRACE <logical-expression>

Database Functions

These functions are used to interrogate, update, and position databases.

Write the specified record to the end of the database

SAVE <record-name>

POST <record-name>

Position the current record

position <database> at [the first occurrence of] <key>

Save any changes to the specified record

update <record-name>

Delete the current database record

delete current record from <database>

Insert the specified record after the current record

insert <record-name>

Terminate a database insert

terminate insert <database>

Read the next record of the database

READ

Usage: READ <database name>

READ demo.tek>

Saves the variable.

SAVE

Usage: SAVE <database name>

SAVE db2>

Delete the current record from databases.

DELETE CURRENT RECORD FROM

Usage: DELETE CURRENT RECORD FROM <database>

Inserts a record into a database

INSERT

Usage: INSERT <record name>

INSERT db1:entr>

Mathematical Functions

ABS(x)

ACOS(x)

ASIN(x)

ATAN(x)

COS(x)

EXP(x)

FORMAT(x,f)

FRAC(x)

INT(x)

LJUST(x)

LN(x)

LOG(x)

MAX(a,b,c,d,...)

MIN(a,b,c,d,...)

MOD(a,b)

SGN(x) Return the sign of a value: -1, 0, or 1, for example, SGN(-123.34) = -1

SIN(x)

SQRT(x)

TAN(x)

String Functions

LOWCASE(s)

MATCH(p,s)

A logical function that returns the result of a string comparison using wildcard matching, compare `s' against pattern `p',

MATCH("A*Z","ABCZ") = 1

PACK(s)

RJUST(s)

SUBSTR(s,a,b)

Return the sub string from `s' starting with character `a' and ending with character `b'.

SUBSTR("ABCDEF",3,5) = "CDE"

UPCASE(s)

VALUE(s)

FORMAT(x,f)

Format `x' using the fortran format `f'.

FORMAT(10,"F10.3") = " 10.000"

Operators

Operators are used in expressions to combine string or arithmetic terms.

( )

+

-

*

/

~ (Exponentials)

2~3 = 8

& (String concatenation)

"AB" & "CD" = "ABCD"

AND

EQ

GE

GT

LE

LT

NE

NOT

OR

XOR