Previous SectionIntroduction
Document HomeContents
Line TypesNext Section

All Keywords

All OVM Keywords supported by end user scripts in Wozterm and Wozix are listed alphabetically below.

!$$$$!

Category Program Handling Functions
Description Return to script that called the current script with @INCLUDE. !$$$$! is an alias for @EOSUB See also @INCLUDE.
Note: Use @EOSUB in preference to !$$$$!.
Support Wozterm and Wozix
Syntax !$$$$!
Usage !$$$$!
Parameters None
Return Value None
Errors This keyword does not set the error flag.
Example
! File1.cmd
! This file will include File2.cmd
@COMMENT("In File1.cmd")
@INCLUDE("File2.cmd")
@COMMENT("Back in File1.cmd")
@PAUSE

!------------------------------------------------------------
! File2.cmd
! This file will be included at runtime by File1.cmd
@COMMENT("In File2.cmd")
!$$$$!

Back to Top


ADVANCE

Category Date & Time Functions
Description Advance a date & time by the specified interval units until in the future, or by 1 unit if the 'SINGLE' parameter is supplied. This function is intended to be used in conjunction with time events.
If the optional 'SINGLE' parameter is NOT specified, the current value is repeatedly advanced by the interval specified until the result is in the future.
If the optional 'SINGLE' parameter is used the Date/Time will only be advanced by the interval specified, regardless of whether the result is in the past or not.
Support Wozterm and Wozix
Syntax ADVANCE ( str exp, str exp [, SINGLE] )
Usage ADVANCE ( date_time, interval [, SINGLE ] )
Parameters date_time - Representation of date in valid format (eg. YYYYMMDDhhmm).
interval - Can take the values 0 - 99 with W, D, H, or M. (ie 0 - 99 Weeks, Days, Hours or Minutes)
single (optional) - Restricts advance to a single 'interval'.
Return Value STRING - Future date & time in the format YYYYMMDDhhmmssdow. YYYY is the year, MM is the month, DD is the day, hh is the hour, mm is the minute, ss is the second, and dow is the day of the week.
Errors The error flag is set if the 'date_time' or 'interval' strings are not in a recognised format.
Example
@STRING now, inanhour, tomorrow

@GETDATE(now)
@SET inanhour = ADVANCE(now,"1H",SINGLE)
@SET tomorrow = ADVANCE(now,"1D")

@COMMENT("The date &time now is ",now)
@COMMENT("The date & time in an hour will be ",inanhour)
@COMMENT("The date & time this time tomorrow will be ",tomorrow)

Back to Top


ALL

Category Communication Functions
Description Used with @ORDERED(ALL) for an ORDERED response anywhere in an AXE response. See also @ORDERED.
Support Wozterm and Wozix
Syntax @ORDERED (ALL)
Usage @ORDERED ( ALL )
Parameters None
Return Value None
Errors This keyword does not set the error flag.
Example
@ORDERED( ALL )

Back to Top


AND

Category Program Handling Functions
Description Boolean AND operator, returns TRUE if both expressions evaluate to TRUE.
See also NOT, OR and XOR.
Support Wozterm and Wozix
Syntax bln exp AND bln exp
Usage exp1 AND exp2
Parameters exp1, exp2 - Literal, variable or expression which evaluates to a boolean value (TRUE or FALSE).
Return Value BOOLEAN - TRUE if both expressions evaluate to TRUE, otherwise FALSE.
Errors This keyword does not set the error flag.
Example
@INTEGER num = 0
@STRING key = ""
@INKEY(key,"Press a key")
@SET num = ORD(key)
@DISPLAY("The key pressed ",num)
@IF num > 20 AND num < 80 THEN
    @COMMENT(" is greater than 20 & less than 80")
@ELSE
    @COMMENT(" is less/equal to 20 OR greater than/equal to 80")

Back to Top


@AOMPWORD

Category Communication Functions
Description Ozterm keyword used to set or clear the AOM Password. This is the old Ozterm keyword used to set the AOM password.
Please use @SETPASSWORD('AOM', password_string).
Support This DOS Ozterm keyword has been deprecated - it is NOT supported.
Syntax N/A
Usage N/A
Parameters N/A
Return Value N/A
Errors This command will result in a compile error if used.
Example
N/A

Back to Top


ARGCOUNT

Category Program Handling Functions
Description Returns the number of arguments passed to a script file. Arguments can be passed to script files on the Wozterm / Wozix command lines or by the @INCLUDE and @RUN keywords. There is always at least one argument, which is the name of the script file. See also ARGVALUE.
Support Wozterm and Wozix
Syntax ARGCOUNT ( )
Usage ARGCOUNT ( )
Parameters None
Return Value INTEGER - Number of script arguments.
Errors This keyword does not set the error flag.
Example
@COMMENT("The number of arguments passed to this script is ",ARGCOUNT())

@COMMENT("They are:")
@FOR INTEGER i = 1 to ARGCOUNT()
    @COMMENT("Argument ",i," = ",ARGVALUE(i))

Back to Top


ARGVALUE

Category Program Handling Functions
Description Returns the specified script file argument. Arguments can be passed to script files on the Wozterm / Wozix command lines or by the @INCLUDE and @RUN keywords. There is always at least one argument, which is the name of the script file. See also ARGCOUNT.
Support Wozterm and Wozix
Syntax ARGVALUE ( int exp )
Usage ARGVALUE ( argument_number )
Parameters argument_number - Index (0-indexed) of the argument required. 0 returns the executable name.
Return Value STRING - Requested argument.
Errors The error flag is set if 'argument number' is less than 0 or greater than ARGCOUNT ( ).
Example
@COMMENT("The number of arguments passed to this script is ",ARGCOUNT())

@COMMENT("They are:")
@FOR INTEGER i = 1 TO ARGCOUNT()
    @COMMENT("Argument ",i," = ",ARGVALUE(i))

Back to Top


@AUTODIAL

Category Deprecated Functions
Description Deprecated DOS Ozterm keyword.
Support This DOS Ozterm keyword has been deprecated - it is NOT supported.
Syntax N/A
Usage N/A
Parameters N/A
Return Value N/A
Errors This command will result in a compile error if used.
Example
N/A

Back to Top


@BAUD

Category Communication Functions
Description Sets baud rate, bits and parity for the active COM port connection.
Allowable values for parity: NONE, ODD or EVEN (integer constants)
Support Wozterm and Wozix
Syntax @BAUD ( int exp [, int exp [, int exp]] )
Usage @BAUD(baud_rate[,bits[,parity]])
Parameters baud_rate - Serial port speed to be used, eg. 110, 150, 300, 600, 1200, 2400, 4800, 9600, 19200 or 38400.
bits (optional) - Can have the values 7 or 8.
parity (optional) - If specified then bits must also be specified. Can have the key values NONE, EVEN or ODD, or an expression which evaluates to one of these values.
Return Value None
Errors This keyword does not set the error flag.
Example
@INTEGER baud = 9600
@INTEGER bits = 8
@INTEGER parity = NONE

! legal examples
@BAUD(1200)                ! set baud rate to 1200
@BAUD(38400, 7)            ! set baud to 38400 byte size to 7
@BAUD(19200, 8, NONE)      ! set baud to 19200 byte size to 8 & no parity
@BAUD(baud, bits, parity)  ! set baud to 9600 byte size to 8 & no parity

! illegal example
@BAUD(1200, NONE)          ! cannot set parity without baud & byte size

Back to Top


@BEGIN

Category Program Handling Functions
Description Marks the beginning of a block of commands. Used with @END which marks the end of the block of commands. Together @BEGIN and @END allow lines of commands to be grouped together. This is useful in @IF ... THEN ... ELSE ... statements, and in loops when more than a single command is to be executed. It is customary to indent the lines between the @BEGIN and @END. This indenting is not required by the OVM compiler but will help the user to visualise the extent of the @BEGIN ... @END block.
Support Wozterm and Wozix
Syntax @BEGIN ... @END
Usage @BEGIN code @END
Parameters code - A script code segment, an instruction (or instructions) that does something, eg SET, GOTO, GOSUB, etc.
Return Value None
Errors This keyword does not set the error flag.
Example
@CONSTANT INTEGER numloops = 10

@FOR INTEGER i = 1 TO numloops
@BEGIN
    @COMMENT("The current loop is loop number ",i)
    @COMMENT("There have been ",i-1," loops prior to this one")

    @IF i = numloops THEN
        @COMMENT("This was the ",numloops,"th loop")
    @ELSE
    @BEGIN
        @DISPLAY("There are another ")
        @DISPLAY(numloops-i)
        @COMMENT(" loops still to come")
    @END
@END

Back to Top


@BELL

Category Program Handling Functions
Description Requests the user's PC to play a defined sound
Note: Sounds include the standard beep (the default) or one of 5 different Windows sounds (parameter value 1 to 5).
Support Wozterm and Wozix
Syntax @BELL ( [int exp] )
Usage @BELL([tone])
Parameters tone (optional) - Selects one of 6 different sounds, ie:
0 - computer speaker beep
1 - Standard Windows sound "Default Beep"
2 - Standard Windows sound "Asterisk"
3 - Standard Windows sound "Exclamation"
4 - Standard Windows sound "Critical Stop"
5 - Standard Windows sound "Question"
Return Value None
Errors This keyword does not set the error flag.
Example
@INTEGER error = 0
@INTEGER ok = 1
@INTEGER warning = 5

! legal examples
@BELL()                     ! sound beep tone by default
@BELL(error)                ! sound beep tone
@BELL(1)                    ! make Windows "OK" sound
@BELL(warning)              ! make Windows "question" sound
@BELL(-1)                   ! sound beep tone by default

Back to Top


@BMODDIR

Category Deprecated Functions
Description Deprecated DOS Ozterm keyword.
Support This DOS Ozterm keyword has been deprecated - it is NOT supported.
Syntax N/A
Usage N/A
Parameters N/A
Return Value N/A
Errors This command will result in a compile error if used.
Example
N/A

Back to Top


@BOOLEAN

Category Program Handling Functions
Description Used to define boolean type variables and arrays. Boolean variables can only be in one of two states - TRUE or FALSE. If not explicitly set, the variable will be set with the compiler's default value of FALSE (OFF).
See also DEFAULTVALUE. For examples and further information on using variables, refer to Variables
Support Wozterm and Wozix
Syntax @BOOLEAN var_name [ [ DEFAULTVALUE ] = bln exp ]
Usage @BOOLEAN var_name [ [ DEFAULTVALUE ] = value ]
Parameters var_name - The name to assigned to the variable consisting of up to 30 characters (a - z, A - Z, _, 0 - 9) starting with a letter or an underscore.
DEFAULTVALUE (optional) - to assign a specific default value to the variable at compile time.
value (optional) - Literal, variable or expression which evaluates to a boolean value, TRUE or FALSE (ON or OFF).
Return Value None
Errors This keyword does not set the error flag.
Example
@BOOLEAN t = TRUE
@BOOLEAN f = FALSE
@BOOLEAN novalue
@IF t THEN
    @COMMENT("'t' is set to TRUE")
@IF NOT f THEN
    @COMMENT("'f' is set to FALSE")
@IF NOT novalue THEN
    @COMMENT("'novalue' is set to (compiler's default) FALSE")

Back to Top


BOX

Category Screen / Input / Output Functions
Description Used by @DRAW as a sub-command to draw a box. The box created by the @DRAW command is displayed within the @WINDOW window. The box is filled with the blue background colour, and has a single line cyan on blue border.
Support Wozterm
Syntax @DRAW ( BOX, int exp, int exp, int exp, int exp )
Usage @DRAW ( BOX, left, top, right, bottom )
Parameters left - First (left most) column of box.
top - First (upper most) row of box.
right - Last (right most) column of box.
bottom - Last (lower most) row of box.
Return Value None
Errors This keyword does not set the error flag.
Example
@DRAW(CUP,20,1,INV,"A box will appear below this line")
@DRAW(BOX,1,2,80,21)
@delaysec(5)

Back to Top


@BREAK

Category Communication Functions
Description Sends a break to the currently connected host or network element.
Support Wozterm and Wozix
Syntax @BREAK
Usage @BREAK
Parameters None
Return Value None
Errors This keyword does not set the error flag.
Example
@INTEGER count = 0
@WINDOW
@LABEL RETRY
    @COMMENT("disconnecting from ESSNET...")
    @DELAYSEC(1)
    @BREAK
    @DELAYSEC(1)
    @SEND(#9)
    @CHECK(OFF)
    @CALL WAITFOR(5,"HOTLINE")
    @CHECK(ON)
    @SET count = count + 1
    @IF count = 3 THEN GOTO DONE
@IFERROR then GOTO RETRY

@LABEL DONE
@STOP

Back to Top


BYREF

Category Program Handling Functions
Description Specifies an argument passed by reference to a procedure or function. If the value is changed in the procedure or function, the original value sent to the procedure or function will also be changed.
See also @PROCEDURE and @FUNCTION
Support Wozterm and Wozix
Syntax @PROCEDURE name ( BYREF type var )
Usage @PROCEDURE name( BYREF (INTEGER/BOOLEAN/STRING) var )
Parameters type - Specifies the type of variable, ie INTEGER, BOOLEAN or STRING
var - Name assigned to the parameter variable.
Return Value None - The value assigned to the variable in the procedure or function is returned to the original variable specified in the procedure or function call.
Errors This keyword does not set the error flag.
Example
@PROCEDURE GetChoice(BYREF INTEGER choice)
@BEGIN
    @STRING entry = STR(choice)
    @INPUT(entry,"Enter 1,2 or 3 and press ENTER: ")
    @SET choice = INT(entry)
@END

@INTEGER yourChoice = 0
@GetChoice(yourChoice)
@COMMENT("The choice you made was: ",yourChoice)

Back to Top


@CALL

Category Program Handling Functions
Description Invoke a @FUNCTION and discard the return value. Useful when you don't need to know the @FUNCTION's return value. You can also use @CALL when calling commands or procedures but there is no need to.
Support Wozterm and Wozix
Syntax @CALL function
Usage @CALL function
Parameters function - Name (and parameters) of the function to be invoked.
Return Value None
Errors This keyword does not set the error flag.
Example
@STRING date = "20030101"
@INTEGER dayOfWeek = -1
@CALL GETDAY(date,dayOfWeek)

Back to Top


@CAT

Category Deprecated Functions
Description Deprecated DOS Ozterm keyword.
Support This DOS Ozterm keyword has been deprecated - it is NOT supported.
Syntax N/A
Usage N/A
Parameters N/A
Return Value N/A
Errors This command will result in a compile error if used.
Example
N/A

Back to Top


@CATFILE

Category Deprecated Functions
Description Deprecated DOS Ozterm keyword.
Support This DOS Ozterm keyword has been deprecated - it is NOT supported.
Syntax N/A
Usage N/A
Parameters N/A
Return Value N/A
Errors This command will result in a compile error if used.
Example
N/A

Back to Top


@CHDIR

Category File / Disk Handling Functions
Description Changes the current working directory. Can use relative paths from current working directory, ie @CHDIR("..") to change to parent directory, or drive letters to select a different drive, eg. @CHDIR("D:"). See also @GETDIR, @MACHINEDIR, @MKDIR, @PROGRAMDIR, @RMDIR, @SAVEDIR, @SESSIONDIR and @USERDIR.
Support Wozterm and Wozix
Syntax @CHDIR ( str exp )
Usage @CHDIR ( drive_path )
Parameters drive_path - The directory or drive to be set as the current working directory.
Return Value None
Errors Error flag set if the path or drive is invalid.
Example
@CHECK(OFF)
@STRING EXE_DIR = ""
@SAVEDIR(EXE_DIR)
@EXE_DIR = COPY(EXE_DIR,1,POS("\",EXE_DIR,LAST))
@CHDIR(CONCAT(EXE_DIR,"SCRIPTS\"))
@IFERROR THEN COMMENT("Scripts directory does not exist")
@ELSE
@BEGIN
    @STRING CURR_DIR = ""
    @GETDIR(CURR_DIR)
    @COMMENT("New working directory is '",CURR_DIR,"'")
@END

Back to Top


@CHECK

Category Program Handling Functions
Description Turns runtime script error checking on or off, with optional trap. A @TRAP may be specified with @CHECK(ON/OFF, trap_name). If turned off then @IFERROR can be used to check for errors. The default value is ON with no trap subroutine.
See also @CHECKSTATE, @SETERRORFLAG and @GETERRORFLAG
Note: Check status is local to a procedure or function. It is set to its current state upon entering a procedure or function and restored to previous state upon exit.
Support Wozterm and Wozix
Syntax @CHECK ( bln exp [, trap] )
Usage @CHECK ( ON / OFF [, trap_name ] )
Parameters ON - Turns command reply and script command checking on. This means the script file will stop on most errors and ask the user if they want to continue or not, as well as set the error flag.
OFF - Turns command reply and script command checking off and clears the error flag. This means the script file will continue on all but "fatal" errors, and set the error flag
trap_name (optional) - Name of the @TRAP subroutine to be invoked if a runtime error is encountered.
Return Value None
Errors This keyword does not set the error flag.
Example
!** example 1 **
@TRAP OnError
@BEGIN
    @COMMENT("A runtime error has been trapped")
    @PROMPT
    @SETERRORFLAG(OFF,0)
@END

@INTEGER zero = 0
@CHECK(OFF,onError)
@INTEGER result = 1 / zero
@SET result = 1 / zero

!** example 2 **
@PROCEDURE commentstuff
@BEGIN
    ! check would be off at this point
    @COMMENT("Just a comment")
@END

@CHECK(OFF)
! check is off at this point
@commentstuff
! check is off at this point

Back to Top


CHECKSTATE

Category Program Handling Functions
Description Returns whether script runtime checking is ON or OFF. See also @CHECK.
Support Wozterm and Wozix
Syntax CHECKSTATE ( )
Usage CHECKSTATE ( )
Parameters None
Return Value BOOLEAN - TRUE if runtime error checking is currently ON, otherwise FALSE
Errors This keyword does not set the error flag.
Example
@IF NOT CHECKSTATE() THEN
    @CHECK(ON)
@COMMENT("Runtime error checking is ON")

Back to Top


CHR

Category Data Manipulation Functions
Description Returns the ASCII character equivalent of an integer. See also @ORD.
Support Wozterm and Wozix
Syntax CHR ( int exp )
Usage CHR ( ascii_code )
Parameters ascii_code - Decimal ASCII Number 0-255 inclusive for character.
Return Value STRING - ASCII equivalent character, eg 65 = A.
Errors Error flag is set if the parameter value, 'ascii_code', is not within the ASCII range of 0-255.
Example
@PROCEDURE DisplayASCII(INTEGER code)
@BEGIN
    @CHECK(OFF)
    @STRING char = CHR(code)
    @IFERROR THEN COMMENT("Error: code outside ASCII character range")
    @ELSE DISPLAY(char)
@END

@DisplayASCII(72)        ! H
@DisplayASCII(69)        ! E
@DisplayASCII(76)        ! L
@DisplayASCII(76)        ! L
@DisplayASCII(79)        ! O

Back to Top


@CLEAR

Category Data Manipulation Functions
Description Clears a variable by setting to 0, false or an empty string depending on its type.It is preferable to use @CLEAR, rather than assignment (eg @set myvar = 0), as the OVM compiler will generate optimised code to clear the variable. @CLEAR can also be used with arrays to clear the entire array.
Support Wozterm and Wozix
Syntax @CLEAR ( var )
Usage @CLEAR ( var_name )
Parameters var_name - Name of defined variable or variable array to be cleared.
Return Value None
Errors This keyword does not set the error flag.
Example
@STRING astring = "string"
@INTEGER anumber = 10
@BOOLEAN aboolean = TRUE
@CLEAR(astring)
@CLEAR(anumber)
@CLEAR(aboolean)
@COMMENT("astring = '",astring,"'")
@COMMENT("anumber = ",anumber)
@COMMENT("aboolean = ",aboolean)

Back to Top


@CLOSE

Category File / Disk Handling Functions
Description Closes the specified event log file or terminal log file if no name given. See also @LOG and TEXTEVSET.
Note: As events are not supported by Wozix, this command can only be used to close the terminal log file under Wozix.
Support Wozterm and Wozix
Syntax @CLOSE ( [str exp] )
Usage @CLOSE [ ( log_file ) ]
Parameters log_file (optional) - Wozterm only, the name of specific event log file that is to be closed.
Return Value None
Errors This keyword does not set the error flag.
Example
@STRING subfile = "SUBS.LOG"
@LOG(subfile)
@CLOSE

Back to Top


@CLRSCR

Category Screen / Input / Output Functions
Description Clears the terminal window or @WINDOW window. If the @WINDOW window is open, its contents is completely cleared otherwise the terminal window is cleared. You can force it to clear the terminal window regardless if window is open or not by specifying force_to_term TRUE
Support Wozterm and Wozix
Syntax @CLRSCR ( [bln exp] )
Usage @CLRSCR[ (force_to_term) ]
Parameters force_to_term (optional) - if set to TRUE, the terminal window is cleared regardless of whether @WINDOW is open or not.
Return Value None
Errors This keyword does not set the error flag.
Example
@INTEGER i
@FOR i = 1 TO 500
    @COMMENT("Line ",i)
@DELAYSEC(2)
@CLRSCR
@DELAYSEC(2)

! ------------------ OR ------------------

@WINDOW
    @DRAW(BOX,1,1,80,30)
    @FOR i = 0 TO 25
    @BEGIN
        @DRAW(CUP,2,2+i)
        @COMMENT("Line ",i)
    @END
    @DELAYSEC(2)
    @CLRSCR
    @DELAYSEC(2)
@WINDEND

Back to Top


@CMDHIST

Category File / Disk Handling Functions
Description Save or restore the command history to or from a file. This allows a command file to load a set of command templates into the command history. Another use of this function could be to save the command history before executing a command file, and then restoring the original command history when the command file has completed its task.
When restoring ('action' = "read"), the text contained in the command history file is loaded into the command history window. If any limits exist for the command history window, and this limit is exceeded when restoring, the oldest commands (those at the start of the file) may be lost. The command history will restore as many of the most recent commands (those at the end of the file) as is possible within the command history limits.
When saving (action = "write") the command history, only the most recent 'N' commands shall be written to the command history file, where 'N' is defined for the command handler. This limit prevents the command history file from growing without limit. If the target file does not exist, it shall be created, otherwise the existing target file shall be overwritten.
Support Wozterm
Syntax @CMDHIST ( str exp [, str exp] )
Usage @CMDHIST ( filename [ , action ] )
Parameters filename - The file the command history is to be written to or restored from.
action (optional) - Determines whether the command history is to be saved to or restored from the file. Valid values for this parameter are "read" or "r", "write" or "w". It is not case sensitive, and the default value when the parameter is not specified is "read".
Return Value None
Errors This keyword does not set the error flag.
Example
@STRING history = "history.sav"
@CMDHIST(history, "write") @@ Save the command history
    :  :   :
    :  :   : @@ Command file fills command
    :  :   : @@ history with many (repeats
    :  :   : @@ of) commands.
    :  :   :
@CMDHIST(history) @@ Restore the command history

Back to Top


@CNTRLD

Category Communication Functions
Description Sends a CONTROL-D to host / network element with optional 4 second WAIT for quiet line. See also WAIT.
Support Wozterm and Wozix
Syntax @CNTRLD ( [WAIT] )
Usage @CNTRLD [ ( WAIT ) ]
Parameters WAIT (optional) - Waits for up to 4 seconds for a quiet line before continuing in the script file.
Return Value None
Errors This keyword does not set the error flag.
Example
@LABEL RELTES1
DIVAP:BNR=5, BAN=22, VLN=H0;
@IF SCAN("00FF") <> 0 THEN GOTO RELTES2
@DELAY(1)
@GOTO RELTES1
@LABEL RELTES2
@CNTRLD
@CALL WAITFOR(0,"START")

Back to Top


@COMMENT

Category Screen / Input / Output Functions
Description Displays text on terminal window or @WINDOW window followed by CR/LF. @COMMENT converts any non-string parameters passed to it to a string representation before displaying them. Each call to @COMMENT will also cause a newline (ie @COMMENT() or @COMMENT will generate a new line). @COMMENT(#7) will generate a beep tone, but only if the Terminal window is active. For a reliable audible response, use @COMMENTTML(#7) instead. See also @WINDOW, @COMMENTTML and @DISPLAY.
Support Wozterm and Wozix
Syntax @COMMENT ( [, exp...] )
Usage @COMMENT [ ( [ , text ... ] ) ]
Parameters text (optional) - 0 of more variables or strings each separated by a comma. If no parameter is specified, a new line is written to the output window.
Return Value None
Errors This keyword does not set the error flag.
Example
@STRING name = "Fred"
@INTEGER age = 24
@BOOLEAN donorStatus = FALSE
@COMMENT
@COMMENT(name," is ",age," years old, donor status - ",donorStatus)
@COMMENT()

! ------------------ OR ------------------

@WINDOW(ON)
    @COMMENT
    @COMMENT(name," is ",age," years old, donor status - ",donorStatus)
    @COMMENT()
    @DELAYSEC(2)
@WINDEND

Back to Top


@COMMENTTML

Category Screen / Input / Output Functions
Description Displays text on the terminal window , always followed by CR/LF. Identical to @COMMENT except will always direct output to terminal even within an @WINDOW/@WINDEND block. Use it in preference to @COMMENT when the terminal may be hidden, eg #COMMENTTML(#7) will always produce a beep. See also @DISPLAY.
Support Wozterm and Wozix
Syntax @COMMENTTML ( [, exp...] )
Usage @COMMENT [ ( [ , text ... ] ) ]
Parameters text (optional) - 0 of more variables or string constants each separated by a comma. If no parameter is specified, a new line is written to the output window.
Return Value None
Errors This keyword does not set the error flag.
Example
@STRING name = "Fred"
@INTEGER age = 24
@BOOLEAN donorStatus = FALSE
@WINDOW(ON)
@COMMENTTML
@COMMENTTML(name," is ",age," years old, donor status - ",donorStatus)
@COMMENTTML("All text displayed in Terminal Window, even though the @WINDOW tab is open")
@DELAYSEC(2)
@WINDEND

Back to Top


CONCAT

Category Data Manipulation Functions
Description Concatenates 2 or more expressions together as string values, up to a maximum 255 characters. CONCAT converts any non-string parameters passed to it to a string representation before concatenation occurs. CONCAT is an alias for STRCONCAT.
Note: The '+' operator can also be used to concatenate strings.
Support Wozterm and Wozix
Syntax CONCAT ( exp, exp [, exp...] )
Usage CONCAT ( text, text [ , text ... ] )
Parameters text - Two or more variables or string constants each separated by a comma.
Return Value STRING - The concatenation of all parameters.
Errors This keyword does not set the error flag.
Example
@STRING temp, EXE_DIR, log_file, buffer
@boolean log_open
@SAVEDIR(EXE_DIR)
@EXE_DIR = COPY(EXE_DIR,1,POS("\",EXE_DIR,LAST))
@INPUT(temp,"Please enter new log name:")
@log_file = CONCAT(EXE_DIR,temp,".log")
@LOG(log_file)
@SET buffer = GETLOG(log_open)
@if log_open then
  @COMMENT("Current log file is '",buffer,"' which is open")
@else
  @COMMENT("Current log file is '",buffer,"' which is closed")
@close
@SET buffer = GETLOG(log_open)
@if log_open then
  @COMMENT("Current log file is '",buffer,"' which is open")
@else
  @COMMENT("Current log file is '",buffer,"' which is closed")

Back to Top


@CONNECT

Category Communication Functions
Description Establish a connection to a host, network element or Serial COM port. May also log in to reach a command prompt (dependent on mode and destination).
This command is designed to allow connection to target network elements through intermediate access control systems that may require their own usernames and passwords. Two examples are NEM and DCAP, both of which act as gateways to exchanges. If insufficient parameters are provided to initiate a connection attempt for the current mode a dialogue box will be displayed to the user so that the required details can be obtained (Wozterm Only). If insufficient details are supplied to successfully connect to the site in a Wozix session, the connection attempt will fail.
Note: This command is normally preceded by @MODE to select the correct mode, and may need to be followed by a @LOGON before a command can be entered into the destination. For a list of connect error codes and their descriptions, see connect errors.
Support Wozterm and Wozix
Syntax @CONNECT ( [str exp [, str exp [, str exp [, str exp [, str exp]]]]] )
Usage @CONNECT ( [destination [, connection_path [, username [, password [, new_password]]]]] )
Parameters destination (optional) - Identifies the target host, network element or COM port, eg @connect("EXDD") or @connect("nem.telecom.com.au") or @connect("COM1"). If not specified in a Wozterm session the Connect dialogue box will be displayed for user input.
connection_path (optional) - Specifies a connection method system, for example an alternate host to the normal site, eg. @connect("EXDD","anothernem.telecom.com.au"). The default host is used if left empty, eg. @connect("EXDD","")
username (optional) - Username required by connection method. If not supplied the current default value for the current mode will be used.
password (optional) - Password required by connection method. If not supplied the current default value for the current mode will be used.
new_password (optional) - New password to enter if the current password has expired. If not supplied in Wozterm, a dialogue box will be displayed for user input, if required.
Return Value None
Errors The Error flag is set if the connection attempt fails.
Example
@MODE("NEM AXE")
@CONNECT("EDSA","",nemusername,nempassword,newnempassword) ! connect
CACLP;
@LOGOFF                ! logoff from EDSA
@DISCONNECT("EDSA")    ! disconnect from EDSA but remain connected to NEM
@CONNECT("EDSB")       ! connect to EDSB using current NEM session
CACLP;
@LOGOFF                ! logoff from EDSB
@DISCONNECT            ! disconnect from EDSB and NEM

@MODE("MANUAL")
@connect("COM1")       ! Connect to Serial port COM1
@BAUD(9600,7,even)     ! Set the baud rate, etc
@DISCONNECT            ! disconnect from the COM port

Back to Top


@CONSTANT

Category Program Handling Functions
Description Used in a variable declaration to define a constant. Constants can be used in place of a literal of the same type. A constant obeys the same scope rules as for a variable.
Note: It is NOT possible to use runtime functions (eg. STRLENGTH) as part of the initialisation expression but you can use operators (excluding [], and {}). See example below. See also @BOOLEAN, @INTEGER and @STRING.
Support Wozterm and Wozix
Syntax @CONSTANT (INTEGER/BOOLEAN/STRING) name = value
Usage @CONSTANT (INTEGER/BOOLEAN/STRING) const_name = const_value
Parameters (INTEGER/BOOLEAN/STRING) - The type of the constant either INTEGER, BOOLEAN or STRING.
const_name - Name of the constant.
const_value - Value (permanently) assigned to the constant.
Return Value None
Errors This keyword does not set the error flag.
Example
@CONSTANT STRING date = "20030101"
@CONSTANT INTEGER dayOfWeek = -1
@CONSTANT BOOLEAN onOff = ON

@CONSTANT STRING logFile = date + ".log" ! OK
@CONSTANT INTEGER numchars = STRLENGTH("A String") ! NOT ALLOWED
! Constants must be initialised with literals or constants

@CALL GETDAY(date,dayOfWeek) ! NOT ALLOWED
! The second parameter required for @GETDAY is a variable name
! and the value of the variable is altered within the function

Back to Top


COPY

Category Data Manipulation Functions
Description Returns a substring of a string. Starting from the position specified in second parameter for the length specified in the third. The first character is position 1.
Copy will copy up to the end of the string or truncate at 255 characters whichever comes first. No characters are returned if copying after the end of the string.
COPY is an alias for STRCOPY.
Support Wozterm and Wozix
Syntax COPY ( str exp, int exp, int exp )
Usage COPY ( source_string, start_position, copy_length )
Parameters source_string - Main string from which to extract the substring.
start_position - Point of 'source_string' to start copying. The first character is position 1.
copy_length - Number of characters past 'start_position' to be copied.
Return Value STRING - A substring of 'source_string'. The substring will be 'copy_length' characters long starting from position 'start_position'.
Errors This keyword does not set the error flag.
Example
@STRING date_time
@GETDATE(date_time)
@STRING date = COPY(date_time,1,8)
@STRING time = CONCAT(COPY(date_time,9,2),":",COPY(date_time,11,2))
@STRING day = COPY(date_time,15,3)
@COMMENT(" * Check PC time and date..")
@COMMENT(" DATE=",date," DAY=",day," TIME=",time)

Back to Top


CUP

Category Screen / Input / Output Functions
Description Used by @DRAW as a sub-command to position the cursor. Movement of the cursor with the @DRAW command is used for the placement of text within the @WINDOW window.
Support Wozterm
Syntax @DRAW ( CUP, int exp, int exp )
Usage @DRAW ( CUP, column, row )
Parameters column - New column number for the cursor.
row - New row number for the cursor.
Return Value None
Errors This keyword does not set the error flag.
Example
@WINDOW
    @DRAW(BOX,1,1,80,25)
    @DRAW(CUP,1,1,INV,"1")
    @DRAW(CUP,80,1,"2")
    @DRAW(CUP,80,25,"3")
    @DRAW(CUP,1,25,"4")
    @DRAW(CUP,40,13,HIGH,"CENTRE")
    @delaysec(20)
@WINDEND

Back to Top


@DEBUG

Category Program Handling Functions
Description Displays a message in the debug window if the debug level is important enough (lower numbers are more important). If the debug level value is less than or equal to the value set by the last @DEBUGLEVEL command the debug message will be displayed. @DEBUG converts any non-string parameters passed to it to a string representation before displaying them.
Support Wozterm and Wozix
Syntax @DEBUG ( int exp [, exp...] )
Usage @DEBUG ( debug_level [ , text ... ] )
Parameters debug_level - The priority (debug level) of the debug message.
text (optional) - 0 of more variables or string constants each separated by a comma. If no parameter is specified, a new line is written to the output window.
Return Value None
Errors This keyword does not set the error flag.
Example
@DEBUGLEVEL(10)
@DEBUG(0,"A level 0 message should always be displayed")
@DEBUG(10,"This debug message will be displayed")
@DEBUG(11,"But anything less important wont be")

Back to Top


@DEBUGLEVEL

Category Program Handling Functions
Description Sets the debug level that determines if @DEBUG messages are displayed. If the first parameter of an @DEBUG command is less than or equal to the value set by @DEBUGLEVEL the debug information will be displayed.
The minimum value the debug level can be set to is 0 (allows only the most important messages which includes internal errors to be displayed). The maximum level a script should set is 99.
Setting the debug level to 100 or higher will result in OVM's internal debugging information being displayed (not recommended for normal operation).
Support Wozterm and Wozix
Syntax @DEBUGLEVEL ( int exp )
Usage @DEBUGLEVEL ( debug_level )
Parameters debug_level - The maximum debug level of debug messages which should be displayed.
Return Value None
Errors This keyword does not set the error flag.
Example
@DEBUGLEVEL(10)
@DEBUG(0,"A level 0 debug message should always be displayed")
@DEBUG(10,"A level 1 to 10 debug comment will be displayed")
@DEBUG(11,"But anything less important wont be")

Back to Top


@DEC

Category Data Manipulation Functions
Description Decrements the value of an integer variable by 1, or the optionally specified amount.
Note: When incrementing or decrementing integer variables by 1 it is preferable to use @INC or @DEC as the OVM compiler will generate faster code than if an equivalent @SET command was used.
Support Wozterm and Wozix
Syntax @DEC ( int var [, int exp] )
Usage @DEC ( var_name [, amount ] )
Parameters var_name - Name of defined INTEGER variable to be decremented.
amount (optional) - Used to set the amount to decrement by. If not specified, the variable is decremented by 1.
Return Value None
Errors This keyword does not set the error flag.
Example
@INTEGER count = 50

@LABEL MINUS1
@IF count <> 40 THEN
@BEGIN
    @COMMENT(count)
    @DEC(count)
    @GOTO MINUS1
@END

@LABEL MINUS5
@IF count >= 0 THEN
@BEGIN
    @COMMENT(count)
    @DEC(count,5)
    @GOTO MINUS5
@END

Back to Top


DECIMAL

Category Data Manipulation Functions
Description Returns the integer value of a hexadecimal string. See also @HEX.
Support Wozterm and Wozix
Syntax DECIMAL ( str exp )
Usage DECIMAL( hex_string )
Parameters hex_string - String representation of a hexadecimal number.
Return Value INTEGER - The decimal equivalent of the hexadecimal string.
Errors This keyword does not set the error flag.
Example
@INTEGER max2hex = DECIMAL("FF")
@COMMENT("Highest two digit hex number = ",max2hex)

Back to Top


DEFAULTVALUE

Category Program Handling Functions
Description Set a variable's default value other than the standard defaults of 0, FALSE or ''. Use with @INTEGER, @BOOLEAN, @STRING, @LABELREF and @SUBROUTINEREF to assign a specific value to a variable at compile time (thus overriding compiler's default value).
Support Wozterm and Wozix
Syntax @(Variable Type) var DEFAULTVALUE = exp
Usage @(Var_Type) var_name DEFAULTVALUE = value
Parameters (Var_type) - The type of the variable, ie either INTEGER, BOOLEAN, STRING, LABELREF or SUBROUTINEREF.
var_name - Name of the variable.
var_value - The default value assigned to the variable.
Return Value None
Errors This keyword does not set the error flag.
Example
@INTEGER fred = 10             ! assigned at runtime
@INTEGER foo DEFAULTVALUE = 10 ! assigned at compile time

Back to Top


@DEL5MSEC

Category Date & Time Functions
Description Pauses script execution in 5 millisecond intervals.
See also @DELAY, @DELAYSEC and @SLEEP.
Support Wozterm and Wozix
Syntax @DEL5MSEC ( int exp )
Usage @DEL5MSEC ( num_5ms_intervals )
Parameters num_5ms_intervals - Number of 5 millisecond intervals to pause execution.
Return Value None
Errors This keyword does not set the error flag.
Example
@INTEGER 5ms_intervals = 200
@DEL5MSEC(5ms_intervals)    ! Delay for 1 second
@DEL5MSEC(20)               ! Delay for 1/10 of a second.

Back to Top


@DELAY

Category Date & Time Functions
Description Pauses script execution in 1 minute intervals.
See also @DEL5MSEC, @DELAYSEC and @SLEEP.
Support Wozterm and Wozix
Syntax @DELAY ( int exp )
Usage @DELAY ( minutes )
Parameters minutes - Number of minutes to pause execution.
Return Value None
Errors This keyword does not set the error flag.
Example
@INTEGER minutes = 60
@DELAY(minutes)          ! Delay for 1 hour.
@DELAY(1)                ! Delay for 1 minute.

Back to Top


@DELAYSEC

Category Date & Time Functions
Description Pauses script execution in 1 second intervals.
See also @DEL5MSEC, @DELAY and @SLEEP.
Support Wozterm and Wozix
Syntax @DELAYSEC ( int exp )
Usage @DELAYSEC ( seconds )
Parameters seconds - Number of seconds to pause execution.
Return Value None
Errors This keyword does not set the error flag.
Example
@INTEGER seconds = 60
@DELAYSEC(seconds)          ! Delay for 1 minute.
@DELAYSEC(5)                ! Delay for 5 seconds.

Back to Top


@DIALOG

Category Screen / Input / Output Functions
Description Creates a form in a new window, with 1 or more entry fields.
This is an enhanced @FORM with the extra field parameters OBFUSCATE and REQUIRED (string fields only).
Can be used to obtain text, numeric or boolean input from the user. The TAB/Shift TAB keys can be used to move between the fields. Enter accepts all the field values. A number of variables may set using the one @DIALOG command.
Support Wozterm and Wozix
Syntax @DIALOG ( int exp, int exp, int exp, var, str exp, bln exp, bln exp [ [, all repeat...]] )
Usage @DIALOG(col, row, width, var_name, caption, obfuscate, required [, col, row, width, var_name, caption, obfuscate, required]...)
Parameters col - Left most column of the label for the input field. (ie not the actual field, the field will start at col + LENGTH(caption)).
row - Row (line number) on which to place the input field.
width - Number of columns occupied by the input field (not including caption width). The way this parameter behaves depends on the type of input field. For integer fields, 'width' limits the number of digits that may be entered. The maximum size that can be set is equal to the maximum number of digits in an integer (currently 11). If you specify a size greater than this no error is reported but the size specified is overridden. If set to 1 only one digit (no +/-) may be entered. If width is greater than 1 user may enter '+', '-' or a digit in extreme right of field followed by width - 1 digits. eg If width = 2 integer values of +5, -5 or 56 could be entered. If a width of 0 is used, only the label is displayed. Widths not equal to zero has no effect on the size of a boolean check box but a value must be entered in this position.
var_name - Name of defined variable that is associate with input field (ie from which initial value is retrieved and into which the resultant value is stored).
caption - Title (or label) which precedes the input field on the form.
obfuscate - If set to true, the text is obfuscated password style, if false the text entered is shown. This does not apply to boolean fields but you must specify true or false for boolean fields even though this value has no effect.
required - User must enter data into this field. This does not apply to boolean fields but you must specify true or false for boolean fields even though this value has no effect.
Return Value None
Errors This keyword does not set the error flag.
Example
@string Name
@Name = "My Name"

@string password = ""
@string genderText
@boolean male = false
@integer age
@DIALOG(1,1,12,Name,"Enter Name",false,TRUE,\
        1,2,12,password,"Enter Password",true,TRUE, \
        1,3,500,male,"Male",false,false,\
        12,3,2,age,"Age",false,false)
@if male then
        @genderText = concat(" is a ", age, " year old man")
@else
        @genderText = concat(" is a ", age, " year old woman")
@Comment("Name: ", name, " Password: ", password, genderText)

Back to Top


@DISCONNECT

Category Communication Functions
Description Does a full, or partial disconnect if a host name is given, from a network element.
See also @CONNECT.
Support Wozterm and Wozix
Syntax @DISCONNECT ( [str exp] )
Usage @DISCONNECT [ ( host ) ]
Parameters host (optional) - Name of specific host to disconnect from. If connected via NEAS or NEM will just disconnect from the site and remain connected to NEAS or NEM.
Return Value None
Errors This keyword does not set the error flag.
Example
@MODE("NEM AXE")
@CONNECT("EDSA","",nemusername,nempassword) ! connect
CACLP;
@LOGOFF                ! logoff from EDSA
@DISCONNECT("EDSA")    ! disconnect from EDSA (still in NEM)
@CONNECT("EDSB")       ! connect to EDSB
CACLP;
@LOGOFF                ! logoff from EDSB
@DISCONNECT            ! disconnect from EDSB and NEM

Back to Top


DISKFREE

Category File / Disk Handling Functions
Description Returns available disk space on current, or optionally specified disk in kilobytes.
Support Wozterm and Wozix
Syntax DISKFREE ( [str exp] )
Usage DISKFREE ( [ disk_path ] )
Parameters disk_path (optional) - Name of specific disk drive to obtain the free space of.
Return Value INTEGER - The free space on the disk drive, in kilobytes.
Errors This keyword does not set the error flag.
Example
@INTEGER freeKb = DISKFREE()
@COMMENT("Free space = ", freeKb, "Kb")
@COMMENT(DISKFREE("H:"))

Back to Top


@DISPLAY

Category Screen / Input / Output Functions
Description Displays text and variable values to terminal window. If the @WINDOW window is active it will receive the output instead of the terminal window. @DISPLAY converts any non-string parameters passed to it to a string representation before displaying them. In all respects, this command is identical to @COMMENT except that a trailing CR/LF is not added to each string displayed.
Support Wozterm and Wozix
Syntax @DISPLAY ( [, exp...] )
Usage @DISPLAY [ ( [ , text ... ] ) ]
Parameters text (optional) - 0 or more variables or string constants each separated by a comma.
Return Value None
Errors This keyword does not set the error flag.
Example
@DISPLAY("Mary had ")
@COMMENT("a little lamb")
@DISPLAY("Its fleece was ")
@COMMENT("white as snow")

Back to Top


DO

Category Program Handling Functions
Description Used in constructing a @WHILE loop to prefix the block of code to execute. See also @WHILE.
Support Wozterm and Wozix
Syntax @WHILE bln exp DO code
Usage @WHILE condition DO code
Parameters condition - Statement which should evaluate to TRUE if the code segment is to be executed.
code - Instruction (or instructions with @BEGIN ... @END) that does something, eg SET, GOTO, GOSUB, etc.
Return Value None
Errors This keyword does not set the error flag.
Example
@INTEGER count = 0

@WHILE count < 10 DO
@BEGIN
    @COMMENT("count = ",count)
    @INC(count)
@END

! ------------------ OR ------------------

@INTEGER year = INT(COPY(GETDATETIME(),1,4))
@INC(year)
@STRING new_years_day = CONCAT(STR(year),"0101000000001")
@WHILE GETDATETIME() < new_years_day DO
    @SLEEP(1)
@COMMENT("Happy New Year ",year,"!!")

Back to Top


@DOCMD

Category Program Handling Functions
Description Perform an application dependent command. Any returned values can be retrieved by using @DOCMDGETATTR.
Support Wozterm and Wozix
Syntax @DOCMD ( str exp [, exp...] )
Usage @DOCMD ( command [ , parameter ... ] )
Parameters command - The name of the command to be performed by the application.
parameter (optional) - 0 or more arguments that may be required by the command.
Return Value None
Errors The error flag is set if the number of parameters specified exceeds the application limit.
Example
@INTEGER pid
@DOCMD("GETPID")
@DOCMDGETATTR(1,pid)
@COMMENT('PID = ',pid)

Back to Top


@DOCMDGETATTR

Category Program Handling Functions
Description Retrieve a value returned by a previous @DOCMD. See also @DOCMD. Application specific.
Support Wozterm and Wozix
Syntax @DOCMDGETATTR ( int exp, var )
Usage DOCMDGETATTR ( attribute_number, var_name )
Parameters attribute_number - The number (1 indexed) of the attribute to retrieve.
var_name - Name of the defined variable in which to store the retrieve attribute.
Return Value None
Errors The error flag is set if 'attribute_number' is less than 1 or greater than the application limit.
Example
@INTEGER pid
@DOCMD("GETPID")
@DOCMDGETATTR(1,pid)
@COMMENT('PID = ',pid)

Back to Top


@DOCMDSETATTR

Category Program Handling Functions
Description Sets the value of an attribute for a @DOCMD which will follow. Application specific. See also @DOCMD.
Support Wozterm and Wozix
Syntax @DOCMDSETATTR ( int exp, exp )
Usage @DOCMDSETATTR ( attribute_number, value )
Parameters attribute_number - The number (1 indexed) of the attribute to set.
value - The value to assign to the attribute.
Return Value None
Errors The error flag is set if 'attribute_number' is less than 1 or greater than the application limit.
Example
No example script segment available

Back to Top


DOWNTO

Category Program Handling Functions
Description Used in constructing a decrementing @FOR loop. With each iteration of the loop, the variable is decremented, from its initial value to the terminating value. See also @FOR.
Support Wozterm and Wozix
Syntax @FOR [ INTEGER ] var = int exp DOWNTO int exp code
Usage @FOR [INTEGER] var_name = start_val DOWNTO end_val code
Parameters var_name - Name of the integer variable to used in controlling loop. If the variable has not been previously defined, the keyword INTEGER must precede the variable name.
start_val - Numeric value assigned to the loop variable for the first iteration of the FOR loop.
end_val - Numeric value assigned to the loop variable for the last iteration of the FOR loop. Should be less than 'start_val' for the loop to execute.
code - Instruction, or instructions with @BEGIN ... @END, that does something, eg SET, GOTO, GOSUB or even another @FOR loop.
Return Value None
Errors This keyword does not set the error flag.
Example
@FOR INTEGER count = 10 DOWNTO 0
    @COMMENT(count)

Back to Top


@DRAW

Category Screen / Input / Output Functions
Description Draws text and boxes in the @WINDOW window. The keywords BOX, CUP, HIGH, INV and LOW work with this command. All output produced by @DRAW commands is cleared when the script file is stopped or ends. See also @WINDOW.
Support Wozterm
Syntax @DRAW ( str exp/draw sub-cmd [ , str exp/draw sub-cmd ... ] )
Usage @DRAW ( param [ , param ... ] )
Parameters param - @DRAW sub command (BOX, CUP, HIGH, INV, LOW) OR string value to be added to the display.
Return Value None
Errors This keyword does not set the error flag.
Example
@WINDOW
    @DRAW(BOX,1,2,25,15)        ! draw an empty box
    @DRAW(cup,2,5)              ! position the cursor
    @DRAW(HIGH,"High Text")     ! high (bold) intensity text
    @DRAW(cup,6,7)              ! position the cursor
    @DRAW(INV,"Inverse Text")   ! inverse text
    @DRAW(cup,10,9)             ! position the cursor
    @DRAW(LOW,"Normal Text")    ! low (normal) intensity text
    @DELAYSEC(20)
@WINDEND

Back to Top


@DTRBREAK

Category Communication Functions
Description (NOT YET SUPPORTED) Open the serial port's DTR lead for 1 second.
Support Wozterm and Wozix
Syntax @DTRBREAK
Usage @DTRBREAK
Parameters None
Return Value None
Errors This keyword does not set the error flag.
Example
@mode("manual")
@connect("COM1")
@COMMENT("Disconnecting COM1...")
@DTRBREAK
@delaysec(2)
@disconnect

Back to Top


@EDITFILE

Category File / Disk Handling Functions
Description Open text editor with specified file starting at an optionally specified line number.
Support Wozterm
Syntax @EDITFILE ( str exp [, int exp] )
Usage @EDITFILE ( filename[, line ])
Parameters filename - Name of the file to be edited. May be a variable or the actual name of the file.
line (optional) - Line number to move the cursor to when file is initially opened in the editor.
Return Value None
Errors This keyword does not set the error flag.
Example
@STRING file, line
@SELFILE(File,"Input filename to be edited")
@INPUT(line,"Input line number to go to")
@EDITFILE(File,INT(line))

Back to Top


ELSE

Category Program Handling Functions
Description Used with @IF and @IFERROR to catch the fail case. An @ELSE statement is executed only when the condition in the corresponding @IF or @IFERROR statement is FALSE.
Support Wozterm and Wozix
Syntax @IF bln exp THEN code ELSE code
Usage @IF condition THEN code ELSE code
Parameters condition - A variable or expression that can be evaluated to a boolean (TRUE/FALSE) value. The ELSE code segment will be executed if it evaluates to FALSE.
code - Instruction (or instructions with @BEGIN ... @END) that does something, eg SET, GOTO, GOSUB, etc., or another IF statement.
Return Value None
Errors This keyword does not set the error flag.
Example
@INTEGER c = 3
@IF c = 1 THEN COMMENT('c = 1')
@ELSE IF c = 2 THEN COMMENT('c = 2')
@ELSE IF c = 3 THEN COMMENT('c = 3')    ! will perform this comment
@ELSE COMMENT('c <> 1')
@COMMENT('End of Else statements')      ! ...then jump to this line

! ------------------ OR ------------------

@CHECK(OFF)
@OPENREAD("Z:\SomeDir\SomeFile")        ! error as unable to open
@CHECK(ON)
@IFERROR THEN GOTO XERROR               ! evaluates to TRUE
@ELSE IF c = 2 THEN COMMENT("c = 2")
@ELSE IF c = 3 THEN COMMENT("c = 3")
@ELSE COMMENT("No error and c <> 2 and c <> 3")

@LABEL XERROR                           ! ...then jump to this line
@COMMENT("An error has occurred")

Back to Top


@END

Category Program Handling Functions
Description Marks the beginning of a block of commands. The beginning of the block is marked with an @BEGIN. Together @BEGIN and @END allow lines of commands to be grouped together. This is useful in @IF ... THEN ... ELSE statements, and in loops when more than a single command is to be executed. It is customary to indent the lines between the @BEGIN and @END. This indenting is not required by the OVM compiler but will help the user to visualise the extent of the @BEGIN ... @END block.
Support Wozterm and Wozix
Syntax @BEGIN ... @END
Usage @BEGIN code @END
Parameters code - A script code segment, an instruction (or instructions) that does something, eg SET, GOTO, GOSUB, etc.
Return Value None
Errors This keyword does not set the error flag.
Example
@CONSTANT INTEGER numloops = 10

@FOR INTEGER i = 1 TO numloops
@BEGIN
    @COMMENT("The current loop is loop number ",i)
    @COMMENT("There have been ",i-1," loops prior to this one")

    @IF i = numloops THEN
        @COMMENT("This was the ",numloops,"th loop")
    @ELSE
    @BEGIN
        @DISPLAY("There are another ")
        @DISPLAY(numloops-i)
        @COMMENT(" loops still to come")
    @END
@END

Back to Top


@ENDFOR

Category Program Handling Functions
Description Ozterm keyword used to exit a FOR loop before all iterations have occurred, optionally to a specified label.
Use @ENDLOOP instead. See also @FOR.
Support This DOS Ozterm keyword has been deprecated - it is NOT supported.
Syntax N/A
Usage N/A
Parameters N/A
Return Value N/A
Errors This command will result in a compile error if used.
Example
N/A

Back to Top


@ENDLOOP

Category Program Handling Functions
Description Used to exit a loop before all iterations have occurred , optionally to a specified label.
Can be used to exit @FOR, @WHILE and @REPEAT loops.
Support Wozterm and Wozix
Syntax @ENDLOOP ( [label] )
Usage @ENDLOOP [ ( label_name ) ]
Parameters label_name (optional) - Name of label to jump to after exiting the loop.
Return Value None
Errors This keyword does not set the error flag.
Example
@INTEGER i = 0
@WHILE TRUE DO                     ! Endless loop condition
@BEGIN
    @IF i > 10 THEN ENDLOOP(loop3) ! Finish loop explicitly with jump
    @INC(i)
@END

@LABEL loop2
@FOR i = 0 TO 10000000000000       ! Extremely long loop condition
@BEGIN
    @IF i > 10 THEN ENDLOOP        ! Finish loop explicitly
@END
@STOP

@LABEL loop3
@SET i = 0
@REPEAT
@BEGIN
    @IF i > 10 THEN ENDLOOP        ! Finish loop explicitly
    @INC(i)
@END
@UNTIL FALSE                       ! Endless loop condition
@GOTO loop2                        ! Go back to run FOR loop

Back to Top


@EOSUB

Category Program Handling Functions
Description Return to the parent script that called the current script with @INCLUDE. !$$$$! is an alias for @EOSUB. See also @INCLUDE.
Note: Use @EOSUB in preference to !$$$$!.
Support Wozterm and Wozix
Syntax @EOSUB
Usage @EOSUB
Parameters None
Return Value None
Errors This keyword does not set the error flag.
Example
! File1.cmd
! This file will include File2.cmd
@COMMENT("In file1.cmd")
@INCLUDE("file2.cmd")
@COMMENT("Back in file1.cmd")
@PAUSE

!------------------------------------------------------------
! File2.cmd
! This file will be included at runtime by file1.cmd
@COMMENT("In file2.cmd")
@EOSUB

Back to Top


EPOCHTOSTR

Category Date & Time Functions
Description Converts a given epoch time stamp to a date string
Support Wozterm and Wozix
Syntax EPOCHTOSTR ( int exp )
Usage @string time = epochtostr(12312313124)
Parameters No parameter description available
Return Value STRING - date string
Errors This keyword does not set the error flag.
Example
No example script segment available

Back to Top


@ERASE

Category File / Disk Handling Functions
Description Deletes a specified file. Required prior to @LOG if intending to overwrite the log file. Use to prevent appending to a file with @WRITE. @ERASE is an alias for @FILEERASE.
Support Wozterm and Wozix
Syntax @ERASE ( str exp )
Usage @ERASE ( filename )
Parameters filename - Name of the file to be deleted.
Return Value None
Errors The error flag is set if the file exists and cannot be removed.
Example
@STRING logName = GETNAME()
@SET logName = CONCAT(COPY(logName,1,LENGTH(logName)-4),".log")
@ERASE(logName)
@LOG(logName)

Back to Top


@ESCKEY

Category Program Handling Functions
Description Turns Escape Key checking on or off. When escape key checking is turned off a running script cannot be interrupted by pressing the ESC key.
Support Wozterm
Syntax @ESCKEY ( bln exp )
Usage @ESCKEY ( ON / OFF )
Parameters ON - Default. Enables the ESC key interrupt function.
OFF - Disables the ESC key interrupt function.
Return Value None
Errors This keyword does not set the error flag.
Example
@ESCKEY(OFF)   ! Disables ESC key interrupt
.....
.....          ! Sequence of commands
.....          ! that should not be interrupted
.....
@ESCKEY(ON)    ! Enables ESC key interrupt again

Back to Top


@EVDELETE

Category Event Handling Functions
Description Deletes all Text or Time Events for the current file , or only those with the current file and the optional label. See also TEXTEVSET and @TIMEEVSET.
Support Wozterm
Syntax @EVDELETE ( [label] )
Usage @EVDELETE ( [ label_name ] )
Parameters label_name (optional) - Name of the label associated with the event/s to be deleted.
Return Value None
Errors This keyword does not set the error flag.
Example
! Setup the events
@STRING now
@GETDATE(now)
@STRING txtEvLog = "txtevt.log"
@CALL TEXTEVSET(option1,"txt pattern1",txtEvLog)
@CALL TIMEEVSET(option1,ADVANCE(now,"1D",single),"A","1M")
@CALL TEXTEVSET(option2,"txt pattern2",txtEvLog)
@CALL TIMEEVSET(option2, ADVANCE(now,"1W",single),"A","1D")
@STOP

@LABEL option1
    @COMMENT("Event fired for option 1")
    @EVDELETE(option1)    ! Only remove event/s for label option1
    @STOP

@LABEL option2
    @COMMENT("Event fired for option 2")
    @EVDELETE             ! Remove ALL events
    @STOP

Back to Top


EVEN

Category Reserved Words
Description Used with @BAUD to set parity to EVEN. See also @BAUD, ODD and NONE.
Support Wozterm and Wozix
Syntax EVEN
Usage @BAUD(19200, 8, EVEN)
Parameters None
Return Value INTEGER - 2
Errors This keyword does not set the error flag.
Example
@BAUD(9600, 8, EVEN)   ! set baud to 9600 byte size to 8 & even parity

Back to Top


EVLOADED

Category Event Handling Functions
Description Checks if an event has been set using the current script file , or for the current file and optional label. See also TEXTEVSET and @TIMEEVSET.
Support Wozterm
Syntax EVLOADED ( [label] )
Usage EVLOADED ( [ label_name ] )
Parameters label_name (optional) - Name of the label associated with the event/s within the current script file.
Return Value BOOLEAN - TRUE if event/s loaded. Only for current script file (or for the current file & label), otherwise FALSE.
Errors This keyword does not set the error flag.
Example
@STRING now
@GETDATE(now)
@IF NOT EVLOADED(option1)THEN
    @CALL TIMEEVSET(option1,ADVANCE(now,"1D",single),"A","1M")
@IF NOT EVLOADED(option1)THEN
    @CALL TIMEEVSET(option2, ADVANCE(now,"1W",single),"A","1D")
@STOP

@LABEL option1
    @COMMENT("Event fired for option 1")
    @STOP

@LABEL option2
    @COMMENT("Event fired for option 2")
    @IF EVLOADED() THEN
        @EVDELETE
    @STOP

Back to Top


@EVSETPRI

Category Event Handling Functions
Description Gives priority to events using the current script file , or current file and optional label. No other Text or Time Events will be activated until after this one has run, or deleted. If the optional label is specified it will only start this script file at this point. If other events exist using this file name but with different start labels then the one with start point label that is specified will be the only one with priority. Once the priority event has been triggered and its transmit file has run the priority ceases and all other events can occur when triggered.
See also TEXTEVSET and @TIMEEVSET.
Support Wozterm
Syntax @EVSETPRI ( [label] )
Usage @EVSETPRI ( [ label_name ] )
Parameters label_name (optional) - Name of the label associated with the event/s within the current script file.
Return Value None
Errors This keyword does not set the error flag.
Example
@IF NOT EVLOADED(option1) THEN
    @EVSETPRI(option1)
@ELSE
    @EVSETPRI()
@STOP

@LABEL option1
    @COMMENT("Event fired for option 1")
    @STOP

@LABEL option2
    @COMMENT("Event fired for option 2")
    @IF EVLOADED() THEN
        @EVDELETE
    @STOP

Back to Top


@EXECUTE

Category Program Handling Functions
Description Executes an external command or program. Execution will occur via a command line shell and script execution will not continue until the process has be completed.
Note: As Wozterm runs in the 32-bit environment, some responses from @EXECUTE commands may be formatted differently from Ozterm. For example, in Ozterm the DOS "dir" command returns all text in upper case with shortened file names where appropriate. When the same function is performed in Wozterm, long file names are returned without forcing the names to upper case, eg C:\PROGRA~1 will now appear as C:\Program Files. This also means some file name characters are no longer allowed. For example, the ampersand character '&' is used in CMD.EXE to concatenate commands and is no longer allowed as a file name character.
Support Wozterm and Wozix
Syntax @EXECUTE ( str exp )
Usage @EXECUTE ( command )
Parameters command - Command line string to be executed.
Return Value None
Errors The error flag is set if the command line string, 'command', is empty or an error is encountered whilst attempting to execute it. At this stage if the command doesn't exist no error flag set.
Example
@EXECUTE("CMD") ! brings up command line

Back to Top


FAIL

Category Reserved Words
Description Boolean value indicating the fail case, equivalent to 0, FALSE or OFF. Used with C to specify a failed response pattern. See also @SETREPLY
Support Wozterm and Wozix
Syntax FAIL
Usage @SETREPLY ( FAIL , pattern )
Parameters None
Return Value BOOLEAN - False
Errors This keyword does not set the error flag.
Example
@STRING pattern = "terminated"
@SETREPLY(FAIL,pattern)

Back to Top


FALSE

Category Reserved Words
Description Boolean value indicating the false case, equivalent to 0, FAIL or OFF.
Support Wozterm and Wozix
Syntax FALSE
Usage @CHECK(FALSE)
Parameters None
Return Value BOOLEAN - False
Errors This keyword does not set the error flag.
Example
@CHECK(FALSE)
@BOOLEAN state = CHECKSTATE()
@IF (state = FALSE) THEN
    @CHECK(ON)
@COMMENT("Runtime error checking is ON")

Back to Top


FILECHPOS

Category File / Disk Handling Functions
Description Returns the current character position in the specified file. The file must be opened with @FILEOPEN.
Note: This function does not return the character position on the current line, but the absolute character position relative to the start of the file.
Support Wozterm and Wozix
Syntax FILECHPOS ( str exp )
Usage FILECHPOS ( filename )
Parameters filename - Name of the open file from which to obtain the current character position.
Return Value INTEGER - Character number, from start of file, for the current position in the specified file.
Errors The error flag is set if the file has not been opened with @FILEOPEN.
Example
@STRING fn = GETNAME()
@FILEOPEN(fn,'rw')
@FILEEND(fn)
@INTEGER chpos = FILECHPOS(fn)
@COMMENT(chpos," characters in this file.")
@FILECLOSE(fn)

Back to Top


@FILECLOSE

Category File / Disk Handling Functions
Description Closes a file opened by @FILEOPEN. The file should have been opened with @FILEOPEN as this command does not close files opened with the @OPENREAD command. No error is generated if an attempt is made to close a file that is not open.
Support Wozterm and Wozix
Syntax @FILECLOSE ( str exp )
Usage @FILECLOSE ( filename )
Parameters filename - Name of the open file to be closed.
Return Value None
Errors This keyword does not set the error flag.
Example
@STRING fn = GETNAME()
@FILEOPEN(fn,'rw')
@STRING first = FILEREADLN(fn)
@FILECLOSE(fn)
@COMMENT("The first line of this file is '",first,"'.")

Back to Top


@FILECOPY

Category File / Disk Handling Functions
Description Creates a copy of an existing file.
Support Wozterm and Wozix
Syntax @FILECOPY ( str exp, str exp )
Usage @FILECOPY ( source , dest )
Parameters source - Name of the file to be copied.
dest - Name of duplicate file to be created.
Return Value None
Errors The error flag is set if either file is not accessible, or if the path specified is invalid.
Example
@STRING fn = GETNAME()
@STRING backup = CONCAT(COPY(fn,1,LENGTH(fn)-4),".bac")
@FILECOPY(fn,backup)
@IFERROR THEN COMMENT("Unable to create backup")

Back to Top


@FILEEND

Category File / Disk Handling Functions
Description Seeks to the end of the specified file. The character position will be set to the position following the last character in the file (ie used to append the existing data in the file). An attempt to read from the file will return no data, and End of File will be encountered thus setting the error flag. The file must have been opened with @FILEOPEN.
Support Wozterm and Wozix
Syntax @FILEEND ( str exp )
Usage @FILEEND ( filename )
Parameters filename - Name of the open file to seek to the end of.
Return Value None
Errors The error flag is set if the file has not been opened with @FILEOPEN.
Example
@STRING fn = GETNAME()
@FILEOPEN(fn,'rw')
@FILEEND(fn)
@FILEWRITELN(fn,"! This is the new end of file")
@FILECLOSE(fn)
@VIEWFILE(fn)

Back to Top


@FILEERASE

Category File / Disk Handling Functions
Description Deletes the specified file. Required prior to @LOG if intending to overwrite log file. Use to prevent appending to a file with @WRITE. @ERASE is an alias for @FILEERASE.
Support Wozterm and Wozix
Syntax @FILEERASE ( str exp )
Usage @FILEERASE ( filename )
Parameters filename - Name of the file to be deleted.
Return Value None
Errors The error flag is set if file exists and cannot be removed.
Example
@STRING logName = GETNAME()
@SET logName = CONCAT(COPY(logName,1,LENGTH(logName)-4),".log")
@FILEERASE(logName)
@LOG(logName)

Back to Top


FILELNPOS

Category File / Disk Handling Functions
Description Returns the current line number position in the specified file. The file must have been opened with @FILEOPEN.
Support Wozterm and Wozix
Syntax FILELNPOS ( str exp )
Usage FILELNPOS ( filename )
Parameters filename - Name of the open file from which to obtain the current line position.
Return Value INTEGER - Line number for the current position in the specified file.
Errors The error flag is set if the file has not been opened with @FILEOPEN.
Example
@STRING fn = GETNAME()
@FILEOPEN(fn,'rw')
@FILEEND(fn)
@INTEGER lnpos = FILELNPOS(fn)
@COMMENT(lnpos," lines in this file.")
@FILECLOSE(fn)

Back to Top


@FILELNSTART

Category File / Disk Handling Functions
Description Seeks to the start of the current line in the specified file. The character position will be set to the start of the current line. The file must have been opened with @FILEOPEN.
Support Wozterm and Wozix
Syntax @FILELNSTART ( str exp )
Usage @FILELNSTART ( filename )
Parameters filename - Name of the file in which to seek to the start of the current line.
Return Value None
Errors The error flag is set if the file has not been opened with @FILEOPEN.
Example
@STRING fn = GETNAME()
@FILEOPEN(fn,'rw')
@FILEEND(fn)
@FILELNSTART(fn)
@STRING lastline = FILEREADLN(fn)
@COMMENT("The last line of this file is '",lastline,"'.")
@FILECLOSE(fn)

Back to Top


@FILEOPEN

Category File / Disk Handling Functions
Description Opens a file for reading and/or writing. Several files may be opened for reading or writing at the same time using the @FILEOPEN command. See also @OPENREAD, @FILECLOSE, @FILEEND, etc.

The error flag is set if:
  • The file doesn't exist (Read Only mode);
  • The file is not accessible, eg. attempt to select 'RW' on a read-only file;
  • The path specified is invalid; or
  • An invalid mode string is specified, ie. something other than 'R' or 'RW'.
Note: All files opened are closed when the command file terminates.
Support Wozterm and Wozix
Syntax @FILEOPEN ( str exp [, str exp] )
Usage @FILEOPEN ( filename [, open_mode] )
Parameters filename - Name of the file to be opened.
open_mode (optional) - 'R' Read Only or 'RW' Read/Write. Default is Read Only.
Return Value None
Errors For error flag conditions see description above.
Example
@STRING fn = GETNAME()
@FILEOPEN(fn,"RW")
@FILEEND(fn)
@FILEWRITELN(fn,"! This is the new end of file")
@FILECLOSE(fn)

! ------------------ OR ------------------

@SET fn = "Z:\SomeDir\SomeFile"  ! will result in error as unable to open
@CHECK(off)
@FILEOPEN(fn)
@CHECK(on)
@IFERROR THEN GOTO NotThere
@ELSE COMMENT("File '",fn,"' exists")
@FILECLOSE(fn)

@LABEL NotThere
@COMMENT("File '",fn,"' does not exist")
@STOP

Back to Top


FILEREADARRAY

Category File / Disk Handling Functions
Description Read the contents of the specified file into a string array. The contents of the specified file are read from the current position and appended to a string array passed by reference. This function is limited by the size of the buffer (string array) passed to it. If contents are too large for the buffer, the file is read until the buffer is full. The file must have been opened with @FILEOPEN.
See also @FILEWRITEARRAY
Support Wozterm and Wozix
Syntax FILEREADARRAY ( str exp, 1 dimensional str array )
Usage @INTEGER num_chars = FILEREADARRAY(filename, buffer)
Parameters filename - Name of the open file from which to read the byte.
buffer - String array passed by reference to store file contents
Return Value INTEGER - Number of characters read
Errors The error flag is set if the file has not been opened with @FILEOPEN().
Example
! this script will read the contents of file
! specified by fileIn and write to file specified
! by fileOut

@string fileIn = (some file name/path)
@string fileOut = (some file name/path)
@constant integer buffersize=10
@string buffer[buffersize]
@strarrayflush(buffer)

@fileopen(fileIn ,"RW")
@fileopen(fileOut ,"RW")

@while FILEREADARRAY(fileIn,buffer) > 0 do
@begin
        @FILEWRITEARRAY(fileOut, buffer)
        @strarrayflush(buffer)
@end

@fileclose(fileIn)
@fileclose(fileOut)

Back to Top


FILEREADB

Category File / Disk Handling Functions
Description Reads a byte (integer ASCII value of character) from the specified file. The file must have been opened with @FILEOPEN.
Support Wozterm and Wozix
Syntax FILEREADB ( str exp )
Usage @INTEGER byte_read = FILEREADB ( Filename )
Parameters filename - Name of the file from which to read the byte.
Return Value INTEGER - Byte read as ASCII value, 0 to 255, -1 on End-Of-File.
Errors The error flag is set if the file has not been opened with @FILEOPEN, or if any characters are attempted to be read from or beyond the End-Of-File position.
Example
@STRING fn = GETNAME()
@FILEOPEN(fn,'rw')
@INTEGER byte_read = FILEREADB(fn)
@COMMENT("First byte of file has value ",byte_read,".")
@FILECLOSE(fn)

Back to Top


FILEREADCH

Category File / Disk Handling Functions
Description Reads one or more characters from the specified file. The file must have been opened with @FILEOPEN.
The error flag is set if:
  • The file has not been opened with @FILEOPEN;
  • Any characters are attempted to be read from or beyond the End-Of-File position; or
  • Less than 1 character or more than 255 characters are specified.
Support Wozterm and Wozix
Syntax FILEREADCH ( str exp [, int exp] )
Usage FILEREADCH ( filename [, num_of_chars] )
Parameters filename - Name of the open file from which to read the character/s.
num_of_chars (optional) - The number of characters to be read from the file, to a maximum of 255. If not specified 1 character is read.
Return Value STRING - One or more characters from the file from the current file character position, up to the optional 'num_of_chars'.
Errors For error flag conditions see description above.
Example
@STRING fn = GETNAME()
@FILEOPEN(fn)
@CHECK(off)
@STRING data = FILEREADCH(fn,10)
@CHECK(on)
@IFERROR then GOTO endOfFile
@COMMENT("'",data,"' read from file.")
@GOTO done

@LABEL endOfFile
@COMMENT("No data read as EOF reached.")

@LABEL done
@FILECLOSE(fn)

Back to Top


FILEREADLN

Category File / Disk Handling Functions
Description Reads a line of text from the specified file. The file must have been opened with @FILEOPEN.
Support Wozterm and Wozix
Syntax FILEREADLN ( str exp )
Usage FILEREADLN(filename)
Parameters filename - Name of the open file from which to read the line.
Return Value STRING - The line of data in the file from the current file line position.
Errors The error flag is set if the file has not been opened with @FILEOPEN, or the end-of-file has been reached.
Example
@STRING fn = GETNAME()
@FILEOPEN(fn,'rw')
@STRING first = FILEREADLN(fn)
@COMMENT("The first line of this file is '",first,"'.")
@FILECLOSE(fn)

Back to Top


@FILERENAME

Category File / Disk Handling Functions
Description Renames a file by calling the operating systems rename function.
RENAME is an alias for FILERENAME.
Support Wozterm and Wozix
Syntax @FILERENAME ( str exp, str exp )
Usage @FILERENAME(old_filename, new_filename)
Parameters old_filename - Name of the file that is to be renamed.
new_filename - The new name for the file.
Return Value None
Errors Error flag is set if operating system will not permit the rename, eg. old filename does not exist or new filename does.
Example
@STRING logName = GETLOG()                  ! Obtain name of log file
@CLOSE(logName    )                         ! Stop logging to the file
@FILERENAME(logName,CONCAT(logName,".bac")) ! Rename, to keep as backup
@LOG(logName)                               ! Start logging again, new file

Back to Top


@FILESCANCH

Category File / Disk Handling Functions
Description Searches the specified file for a string, or optional occurrence. Uses the value set by @PATTERNLEVEL to determine if pattern is case sensitive. If found, the character position is moved to the start of the requested string. The file must have been opened with @FILEOPEN.
Support Wozterm and Wozix
Syntax @FILESCANCH ( str exp, str exp [, int exp] )
Usage @FILESCANCH( filename, search_text [, occurrence ] )
Parameters filename - Name of the file to scan for 'search_text'.
search_text - The string to be searched for.
occurrence (optional) - Numeric value may be a variable or the actual occurrence required. The default value is 1 (ie the first occurrence).
Return Value None
Errors The error flag is set if the file has not been opened with @FILEOPEN, or if the string (or optional occurrence) is not found, the file character position will not change in this case.
Example
@STRING fn = GETNAME()
! Search For This                    ! (1st occurrence)
@FILEOPEN(fn)
@FILESCANCH(fn,"Search For This")    ! (2nd occurrence)
@COMMENT(FILEREADLN(fn))
@FILESTART(fn)
@FILESCANCH(fn,"Search For This",4)  ! (3rd occurrence)
@COMMENT(FILEREADLN(fn))
! Search For This                    ! (4th occurrence)
@FILECLOSE(fn)

Back to Top


@FILESCANLN

Category File / Disk Handling Functions
Description Searches an open file for the next occurrence of a string. Uses the value set by @PATTERNLEVEL to determine if pattern is case sensitive. If the pattern is found, the character position is moved to the start of the line containing the string which matched the pattern. The file must have been opened with @FILEOPEN.
Support Wozterm and Wozix
Syntax @FILESCANLN ( str exp, str exp )
Usage @FILESCANLN( filename, search_text )
Parameters filename - Name of the open file to scan for 'search_text'.
search_text - The string to be searched for.
Return Value None
Errors The error flag is set if the file has not been opened with @FILEOPEN, or if the string is not found, the file character position will not change in this case.
Example
@STRING fn = GETNAME()
! Search For This                    ! (1st occurrence)
@FILEOPEN(fn)
@FILESCANLN(fn,"Search For This")    ! (2nd occurrence)
@COMMENT(FILEREADLN(fn))
@FILESCANLN(fn,"Search For This")    ! (3rd occurrence)
@COMMENT(FILEREADLN(fn))
! Search For This                    ! (4th occurrence)
@FILECLOSE(fn)

Back to Top


@FILESEEKCH

Category File / Disk Handling Functions
Description Moves the file pointer position by the specified number of characters from the current character position. The file must have been opened with @FILEOPEN.
The error flag is set if:
  • The file has not been opened with @FILEOPEN;
  • Seeking would place the character position before the start-of-file (position will be set to the start-of-file); or
  • Seeking would place the character position beyond the end-of-file (position will be set to the end-of-file).
Note: Seeking is relative to the current character position within the file, NOT from the first character of the file.
Support Wozterm and Wozix
Syntax @FILESEEKCH ( str exp, int exp )
Usage @FILESEEKCH ( filename, offset )
Parameters filename - Name of the open file in which to move the character position.
offset - Change in character position relative to the current position. Can be a positive, 0, or negative numeric value.
Return Value None
Errors For error flag conditions see description above.
Example
@STRING fn = GETNAME()
! Numbers 123456789                  ! Characters to seek through
@FILEOPEN(fn)
@FILESCANCH(fn,"Numbers",1)
@FILESEEKCH(fn,LENGTH("Numbers"))
@FOR INTEGER i = 1 TO 5
@BEGIN
    @FILESEEKCH(fn,1)                ! Skip char
    @STRING ch = FILEREADCH(fn,1)    ! Read char and move to next
    @COMMENT(ch)                     ! Display the char that was read
@END
@FILECLOSE(fn)

Back to Top


@FILESEEKLN

Category File / Disk Handling Functions
Description Moves the file pointer position by the specified number of lines from the current line position. The file must have been opened with @FILEOPEN.
The error flag is set if:
  • The file has not been opened with @FILEOPEN;
  • Seeking would place the character position before the start-of-file (position will be set to the start-of-file); or
  • Seeking would place the character position beyond the end-of-file (position will be set to the end-of-file).
Note: Seeking is relative to the current line position within the file, NOT from the first line of the file.
Support Wozterm and Wozix
Syntax @FILESEEKLN ( str exp, int exp )
Usage @FILESEEKLN ( filename, offset )
Parameters filename - Name of the file in which to move the line position.
offset - Change in line position relative to the current position. Can be a positive, 0, or negative numeric value.
Return Value None
Errors For error flag conditions see description above.
Example
@STRING fn = GETNAME()
@FILEOPEN(fn)                          ! Display This (1)
@FILEEND(fn)                           ! Move to end of file
@INTEGER num_lines = FILELNPOS(fn)     ! Display This (2)
@FILESEEKLN(fn,-(num_lines-1))         ! Seek back to first line
@FOR INTEGER i = 1 TO (num_lines / 2)  ! Display This (3)
@BEGIN
    @FILESEEKLN(fn,1) ! Skip line      ! Display This (4)
    @STRING next_line = FILEREADLN(fn) ! Read line and move to next
    @COMMENT(next_line)! Display line  ! Display This (5)
@END
@FILECLOSE(fn)                         ! Display This (6)

Back to Top


FILESIZE

Category File / Disk Handling Functions
Description Returns the size of a file in bytes.
Support Wozterm and Wozix
Syntax FILESIZE ( str exp )
Usage @INTEGER size = FILESIZE(filename)
Parameters filename - Name of the file.
Return Value INTEGER - Size of file in bytes
Errors Error flag is set if file doesn't exist. Do not use for files larger than maximum integer size. Under Unix systems error flag will always be set but this cannot be guaranteed under Windows
Example
@integer size
@string file_name = 'Messages.log'
@set size = FILESIZE(file_name)
@comment(file_name,' is ',size,' bytes')

Back to Top


@FILESTART

Category File / Disk Handling Functions
Description Seeks to the start of the specified file. The file must have been opened with @FILEOPEN.
Support Wozterm and Wozix
Syntax @FILESTART ( str exp )
Usage @FILESTART ( filename )
Parameters filename - Name of the file in which to seek to the start of.
Return Value None
Errors The error flag is set if the file has not been opened with @FILEOPEN.
Example
@FILEOPEN(fn)
@FILEEND(fn)
@INTEGER num_chars = @FILECHPOS(fn)
@FILESEEKCH(fn,-(RANDOM(num_chars)))
@COMMENT("Line Number: ",FILELNPOS(fn))
@COMMENT("Char Number: ",FILECHPOS(fn))
@FILESTART(fn)
@COMMENT("Line Number: ",FILELNPOS(fn))
@COMMENT("Char Number: ",FILECHPOS(fn))
@FILECLOSE(fn)

Back to Top


@FILEWRITEARRAY

Category File / Disk Handling Functions
Description Writes the contents of a string array to the specified file. The array will be written at the current character position in the file overwriting any exist character or appending if at the end of the file. The file must have been opened with @FILEOPEN in read and write ('RW') mode.
See also @FILEREADARRAY
Support Wozterm and Wozix
Syntax @FILEWRITEARRAY ( str exp, 1 dimensional str array )
Usage @FILEWRITEARRAY ( filename, string_array )
Parameters filename - Name of the open file in which to write the byte.
string_array - array of strings to be written to the file.
Return Value None
Errors The error flag is set if the file has not been opened with @FILEOPEN() in read and write ('RW') mode.
Example
! this script will read the contents of file
! specified by fileIn and write to file specified
! by fileOut
@string fileIn = (some file name/path)
@string fileOut = (some file name/path)
@constant integer buffersize=10
@string buffer[buffersize]
@strarrayflush(buffer)
@fileopen(fileIn ,"RW")
@fileopen(fileOut ,"RW")
@while FILEREADARRAY(fileIn,buffer) > 0 do
@begin
        @FILEWRITEARRAY(fileOut, buffer)
        @strarrayflush(buffer)
@end
@fileclose(fileIn)
@fileclose(fileOut)

Back to Top


@FILEWRITEB

Category File / Disk Handling Functions
Description Writes a byte (ASCII character specified by integer value) to the specified file. The byte will be written at the current character position in the file overwriting any exist character or appending if at the end of the file. The file must have been opened with @FILEOPEN in read and write ('RW') mode.
Support Wozterm and Wozix
Syntax @FILEWRITEB ( str exp, int exp )
Usage @FILEWRITEB ( filename, ascii_code )
Parameters filename - Name of the open file in which to write the byte.
ascii_code - ASCII value, 0 to 255, for character to be written to the specified file.
Return Value None
Errors The error flag is set if the file has not been opened with @FILEOPEN() in read and write ('RW') mode. It is also set if the value provided for the character to be written, 'ascii_code', is out of the range 0-255.
Example
! -> <- Here is where byte is inserted
@STRING fn = GETNAME()
@FILEOPEN(fn,'rw')
@FILESEEKCH(fn,4)
@FILEWRITEB(fn,65)    ! 65 = ASCII code for 'A'
@FILECLOSE(fn)
@VIEWFILE(fn)

Back to Top


@FILEWRITECH

Category File / Disk Handling Functions
Description Writes 1 or more characters to the specified file. The character/s will be written at the current character position in the file overwriting existing characters or appending if at the end of the file. The file must have been opened with @FILEOPEN in read and write ('RW') mode.
Support Wozterm and Wozix
Syntax @FILEWRITECH ( str exp, str exp [ [, matching exp...]] )
Usage @FILEWRITECH ( filename, text [ , text ... ] )
Parameters filename - Name of the file in which to write the character(s).
text - One or more characters to be written to the specified file.
Return Value None
Errors The error flag is set if the file has not been opened with @FILEOPEN() in read and write ('RW') mode.
Example
! This line will be overwritten by strings in commands below
@STRING fn = GETNAME()
@FILEOPEN(fn,'rw')
@FILESEEKCH(fn,2)
@FILEWRITECH(fn,"Each ","string ","is ")
@FILEWRITECH(fn,"written ", "at ","the ")
@FILEWRITECH(fn,"current ","character ")
@FILEWRITECH(fn,"position!!")
@FILECLOSE(fn)
@VIEWFILE(fn)

Back to Top


@FILEWRITELN

Category File / Disk Handling Functions
Description Writes 0 or more strings to the specified file, and appends a newline. If no string parameters are specified, or the concatenation of all specified string parameters produces an empty string, only a new line is written to the file. The string/s will be written at the current character position in the file overwriting existing characters or appending if at the end of the file. The file must have been opened with @FILEOPEN in read and write ('RW') mode.
Support Wozterm and Wozix
Syntax @FILEWRITELN ( str exp [ [, matching exp...]] )
Usage @FILEWRITELN ( filename, [ text ... ] )
Parameters filename - Name of the file in which to write the line/s.
text - 0 or more strings to be written to the file.
Return Value None
Errors The error flag is set if the file has not been opened with @FILEOPEN() in read and write ('RW') mode.
Example
@STRING fn = GETNAME()
@FILEOPEN(fn,'rw')
@FILEWRITELN(fn,"New first line")
@FILEWRITELN(fn,"New ","second ","line ")
@FILEEND(fn)
@FILEWRITELN(fn)
@FILEWRITELN(fn,"Append new line at end of file")
@FILECLOSE(fn)
@VIEWFILE(fn)

Back to Top


@FLUSHALL

Category Program Handling Functions
Description Destroys all {session} variables. See also session variable definition and @FLUSHVAR.
WARNING: If you want to retain some session variable values when using this command, write them to a temporary file first, then read them back after the @FLUSHALL command.
Support Wozterm and Wozix
Syntax @FLUSHALL
Usage @FLUSHALL
Parameters None
Return Value None
Errors This keyword does not set the error flag.
Example
@IF VAREXIST("ses_var1") THEN
    @FLUSHALL
@SET {"ses_var1"} = ARGVALUE(0)
@SET {"ses_var2"} = ARGVALUE(1)
@COMMENT({"ses_var1"})
@COMMENT({"ses_var2"})

Back to Top


@FLUSHVAR

Category Program Handling Functions
Description Destroys a single {session} variable. See also session variable definition and @FLUSHALL.
Support Wozterm and Wozix
Syntax @FLUSHVAR ( str exp )
Usage @FLUSHVAR ( var_name )
Parameters var_name - Name of the session variable to be destroyed.
Return Value None
Errors This keyword does not set the error flag.
Example
@SET {"ses_var1"} = ARGVALUE(0)
@COMMENT({"ses_var1"})
@IF VAREXIST("ses_var1") THEN
    @FLUSHVAR("ses_var1")
@SET {"ses_var1"} = ARGVALUE(1)
@COMMENT({"ses_var1"})

Back to Top


@FOR

Category Program Handling Functions
Description Used to execute an integer counting loop. The loop variable can either be incremented (using TO) or decremented (using DOWNTO) with each iteration. When more than a single command is required per loop a @BEGIN ... @END block can be used. @FOR loops may be nested. The loop body will not be entered if the starting value of the loop variable is greater than the ending value for incrementing (TO) loops (eg @FOR x = 5 TO 3), or the starting value is less than the ending value for decrementing (DOWNTO) loops (eg. @FOR x = 3 DOWNTO 5). The loop will be terminated when the loop counter is greater than or equal to the ending value for incrementing (TO) loops, or when the loop counter is less than or equal to the ending value for decrementing (DOWNTO) loops.
The @NEXTLOOP command can be used to go on to the next iteration of the loop.
The @ENDLOOP command can be used to exit (terminate) a loop before the exit condition is met.
Support Wozterm and Wozix
Syntax @FOR [ INTEGER ] var = int exp (TO/DOWNTO) int exp code
Usage @FOR [INTEGER] var_name = start_val (TO/DOWNTO) end_val code
Parameters var_name - Name of the integer variable to use in controlling loop. If the variable has not previously defined, the keyword INTEGER must precede the variable name.
start_val - Numeric value assigned to the loop variable for the first iteration of the FOR loop.
TO - The loop variable is to be incremented with each iteration.
DOWNTO - The loop variable is to be decremented with each iteration.
end_val - Numeric value assigned to the loop variable for the last iteration of the FOR loop (provided @ENDLOOP is not used). Should be less than 'start_val' for the loop to execute it TO is used, or greater than 'start_val' if DOWNTO is used.
code - Instruction (or instructions with @BEGIN ... @END) that does something, eg SET, GOTO, GOSUB or even another @FOR loop.
Return Value None
Errors This keyword does not set the error flag.
Example
@INTEGER i

@FOR i = 10 DOWNTO 0
    @COMMENT(i)

@FOR i = 0 TO 9              ! 10 x number
@BEGIN
    @IF i > 3 THEN           ! number higher than 39
        @ENDLOOP             ! finish loop prematurely
    @FOR INTEGER j = 1 TO 9  ! individual numbers via nesting
    @BEGIN
        @IF j = 5 THEN       ! if the number ends in a '5'
            @NEXTLOOP        ! skip it
        @COMMENT(i,j)
    @END
    @IF i < 4 THEN           ! if still <= 40
        @COMMENT(i+1,0)      ! display next multiple of 10
    @ELSE                    ! otherwise
        @ENDLOOP             ! finish loop earlier than expected
@END

Back to Top


@FORM

Category Screen / Input / Output Functions
Description Creates a form in a new window, with 1 or more entry fields.
For an advanced version of this keyword which allows a field to be required or obfuscated for password entry see @DIALOG.
Can be used to obtain text, numeric or boolean input from the user. The TAB/Shift TAB keys are used to move between the fields. Enter accepts all the field values. A number of variables may set using the one @FORM command.
Support Wozterm
Syntax @FORM ( int exp, int exp, int exp, var, str exp [ [, all repeat...]] )
Usage @FORM(col, row, width, var_name, caption [, col, row, width, var_name, caption ... ])
Parameters col - Left most column of the label for the input field. (ie not the actual field, the field will start at col + LENGTH(caption)).
row - Row (line number) on which to place the input field.
width - Number of columns occupied by the input field (not including caption width). The way this parameter behaves depends on the type of input field. For integer fields, 'width' limits the number of digits that may be entered. The maximum size that can be set is equal to the maximum number of digits in an integer (currently 11). If you specify a size greater than this no error is reported but the size specified is overridden. If set to 1 only one digit (no +/-) may be entered. If width is greater than 1 user may enter '+', '-' or a digit in extreme right of field followed by width - 1 digits. eg If width = 2 integer values of +5, -5 or 56 could be entered. If a width of 0 is used, only a label is displayed. Widths not equal to zero has no effect on the size of a boolean check box but a value must be entered in this position.
var_name - Name of defined variable that is associate with input field (ie from which initial value is retrieved and in which resultant value is store).
caption - Title (or label) which precedes the input field on the form.
Return Value None
Errors This keyword does not set the error flag.
Example
@string Name
@Name = "My Name"
@string password = ""
@string genderText
@boolean male = false
@integer age
@FORM(1,1,12,Name,"Enter Name",\
      1,2,12,password,"Enter Password",\
      1,3,500,male, "Male", 12,3,2, age,"Age")
@if male then
      @genderText = concat(" is a ", age, " year old man")
@else
      @genderText = concat(" is a ", age, " year old woman")
@Comment("Name: ", name, " Password: ", password, genderText)

Back to Top


FTPCHDIR

NB: This keyword is still being beta tested and is not available with the released version of Wozterm
Category Currently Beta Testing
Description Changes to specified directory on ftp host
Support Wozterm and Wozix
Syntax FTPCHDIR ( int exp, str exp )
Usage ftpchdir ( handle, dir )
Parameters No parameter description available
Return Value BOOLEAN - True if successful, false otherwise
Errors This keyword does not set the error flag.
Example
No example script segment available

Back to Top


FTPCONNECT

NB: This keyword is still being beta tested and is not available with the released version of Wozterm
Category Currently Beta Testing
Description Creates an ftp connection to the given host
Support Wozterm and Wozix
Syntax FTPCONNECT ( str exp )
Usage ftpconnect ( host )
Parameters No parameter description available
Return Value INTEGER - Connection handle
Errors This keyword does not set the error flag.
Example
No example script segment available

Back to Top


FTPDELETE

NB: This keyword is still being beta tested and is not available with the released version of Wozterm
Category Currently Beta Testing
Description Deletes a file from an ftp host
Support Wozterm and Wozix
Syntax FTPDELETE ( int exp, str exp )
Usage ftpdelete ( handle, path )
Parameters No parameter description available
Return Value BOOLEAN - True if successful, false otherwise
Errors This keyword does not set the error flag.
Example
No example script segment available

Back to Top


FTPDIR

NB: This keyword is still being beta tested and is not available with the released version of Wozterm
Category Currently Beta Testing
Description Gets a directory listing and writes it to the specified file
Support Wozterm and Wozix
Syntax FTPDIR ( int exp, str exp, str exp )
Usage ftpdir ( handle, filepath, dirpath )
Parameters No parameter description available
Return Value BOOLEAN - True if successful, false otherwise
Errors This keyword does not set the error flag.
Example
No example script segment available

Back to Top


@FTPDISCONNECT

NB: This keyword is still being beta tested and is not available with the released version of Wozterm
Category Currently Beta Testing
Description Disconnects from an ftp host
Support Wozterm and Wozix
Syntax @FTPDISCONNECT ( int exp )
Usage ftpdisconnect ( handle )
Parameters No parameter description available
Return Value None
Errors This keyword does not set the error flag.
Example
No example script segment available

Back to Top


FTPGET

NB: This keyword is still being beta tested and is not available with the released version of Wozterm
Category Currently Beta Testing
Description Downloads file from an ftp host
Support Wozterm and Wozix
Syntax FTPGET ( int exp, str exp [, str exp [, int exp]] )
Usage ftpget ( handle, destination[, source[, mode]] )
Parameters No parameter description available
Return Value BOOLEAN - True if successful, false otherwise
Errors This keyword does not set the error flag.
Example
No example script segment available

Back to Top


FTPLOGIN

NB: This keyword is still being beta tested and is not available with the released version of Wozterm
Category Currently Beta Testing
Description Logs into an ftp host.
Support Wozterm and Wozix
Syntax FTPLOGIN ( int exp, str exp, str exp )
Usage ftplogin ( handle, username, password )
Parameters No parameter description available
Return Value BOOLEAN - True if successful, false otherwise
Errors This keyword does not set the error flag.
Example
No example script segment available

Back to Top


FTPMKDIR

NB: This keyword is still being beta tested and is not available with the released version of Wozterm
Category Currently Beta Testing
Description Creates a directory on an ftp host
Support Wozterm and Wozix
Syntax FTPMKDIR ( int exp, str exp )
Usage ftpmkdir ( handle, dir )
Parameters No parameter description available
Return Value BOOLEAN - True if successful, false otherwise
Errors This keyword does not set the error flag.
Example
No example script segment available

Back to Top


FTPMODE

NB: This keyword is still being beta tested and is not available with the released version of Wozterm
Category Currently Beta Testing
Description Sets ftp transfer mode, 0 for ASCII, non 0 for binary
Support Wozterm and Wozix
Syntax FTPMODE ( int exp, int exp )
Usage ftpmode ( handle, mode )
Parameters No parameter description available
Return Value INTEGER - transfer mode
Errors This keyword does not set the error flag.
Example
No example script segment available

Back to Top


FTPPUT

NB: This keyword is still being beta tested and is not available with the released version of Wozterm
Category Currently Beta Testing
Description Uploads file to an ftp host.
Support Wozterm and Wozix
Syntax FTPPUT ( int exp, str exp [, str exp [, int exp]] )
Usage ftpput ( handle, dest path[, src path[, mode]] )
Parameters No parameter description available
Return Value BOOLEAN - True if successful, false otherwise
Errors This keyword does not set the error flag.
Example
No example script segment available

Back to Top


FTPPWD

NB: This keyword is still being beta tested and is not available with the released version of Wozterm
Category Currently Beta Testing
Description Gets the present working directory on an ftp host
Support Wozterm and Wozix
Syntax FTPPWD ( int exp )
Usage ftppwd ( handle )
Parameters No parameter description available
Return Value STRING - Directory path
Errors This keyword does not set the error flag.
Example
No example script segment available

Back to Top


FTPRENAME

NB: This keyword is still being beta tested and is not available with the released version of Wozterm
Category Currently Beta Testing
Description Renames a file on an ftp host.
Support Wozterm and Wozix
Syntax FTPRENAME ( int exp, str exp, str exp )
Usage ftprename ( handle, old, new )
Parameters No parameter description available
Return Value BOOLEAN - True if successful, false otherwise
Errors This keyword does not set the error flag.
Example
No example script segment available

Back to Top


FTPRMDIR

NB: This keyword is still being beta tested and is not available with the released version of Wozterm
Category Currently Beta Testing
Description Removes a directory on an ftp host.
Support Wozterm and Wozix
Syntax FTPRMDIR ( int exp, str exp )
Usage ftprmdir ( handle, dir )
Parameters No parameter description available
Return Value BOOLEAN - True if successful, false otherwise
Errors This keyword does not set the error flag.
Example
No example script segment available

Back to Top


FTPSIZE

NB: This keyword is still being beta tested and is not available with the released version of Wozterm
Category Currently Beta Testing
Description Gets the size of the given file on an host
Support Wozterm and Wozix
Syntax FTPSIZE ( int exp, str exp )
Usage ftprmdir ( handle, path )
Parameters No parameter description available
Return Value INTEGER - Size of the specified file on success, -1 on failure
Errors This keyword does not set the error flag.
Example
No example script segment available

Back to Top


@FUNBUSY

Category Communication Functions
Description Sets the number of attempts to retry an AXE command returning FUNCTION BUSY.
Support Wozterm and Wozix
Syntax @FUNBUSY ( int exp )
Usage @FUNBUSY ( attempts )
Parameters attempts - The number of retries which will be made to enter a command before failing with an error. A value of 0 (the default) means that the Script will continually retry the command until terminated by the operator, or FUNCTION BUSY no longer returned.
Return Value None
Errors The error flag is set if the attempts have been exhausted.
Example
@FUNBUSY(3)
@CHECK(OFF)
ALSTP;
@CHECK(ON)
@IFERROR THEN GOTO cmdFailed
@STOP

@LABEL cmdFailed
@COMMENT("Maximum number attempts have been exhausted")
@STOP

Back to Top


@FUNCTION

Category Program Handling Functions
Description Define a user defined function. Similar to @PROCEDURE except that a value is returned. Parameters can be passed by reference (using BYREF) or by value.
Note: Functions must be defined before they can be used. That is, they must appear in the script file before where they are called.
Note: Function body must be enclosed between @BEGIN and @END. For more information see Procedures & Functions overview.
Note: CHECK status is local to a procedure or function. It is set to on (default) upon entering a procedure or function and restored to previous state upon exit.
Support Wozterm and Wozix
Syntax @FUNCTION
Usage @FUNCTION return_type name ( [ param ... ]) code
Parameters return_type - The type (STRING/INTEGER/BOOLEAN) of the value that is returned as result of the function evaluation.
func_name - The name of the function, used when invoking it.
param - 0 or more parameters for the function to use, made up of the keywords INTEGER, BOOLEAN, STRING followed by parameter name separated by ','. To define parameters of different types separate the parameters by ';'.
code - Instruction (or instructions) that does something, eg SET, COMMENT, DISPLAY, CONNECT etc.
Return Value None - The result value for the function. This is set by assigning a value to the function name.
Note: If a return value is not assigned to the function name then the last value returned will be returned again.
Errors This keyword does not set the error flag.
Example
FUNCTION BOOLEAN IsPM()
@BEGIN
    @IF STRCOPY(GETDATETIME(),9,2) > "12" then
        @IsPM = TRUE
    @ELSE
        @IsPM = FALSE
@END

@IF IsPM() THEN
    @COMMENT("Good afternoon")
@ELSE
    @COMMENT("Good morning")

! ------------------ OR ------------------

@FUNCTION INTEGER MyAdd(INTEGER a,b)
@BEGIN
    @SET MyAdd = a + b
@END

@COMMENT("10 + 20 = ",myadd(10,20))

! ------------------ OR ------------------

@FUNCTION STRING MakeDate(STRING month; INTEGER day)
@BEGIN
    @SET MakeDate = STR(day) + " day of " + month
@END

@COMMENT("Today is the ",MakeDate("July",4))

Back to Top


@FUNKEY

Category Program Handling Functions
Description Sets an action for the specified function key (1-20). Defined actions can be activated via Ctrl-F1 through Ctrl-F20.
Note: Ctrl-Shift-F1 through Ctrl-Shift-F10 are aliases for Ctrl-F11 through Ctrl-F20.
Support Wozterm
Syntax @FUNKEY ( int exp [, str exp, str exp [, str exp]] )
Usage @FUNKEY ( keynum [ , action , action_text [ , description ] ] )
Parameters keynum - The number of the function key associated with the action (1-20).
action (optional) - If not provided any existing action assigned to 'keynum' is cleared. If specified, must be one of the following options:
  • "RUN" or "T" - Loads and runs a script file.
  • "KEYSTROKES" or "L" - Emulate a keystroke within the terminal window.
  • "SEND" or "S" - Forward 'action_text' to connected host.
  • "HOSTCMD" or "A" - Execute host command.
action_text (optional) - Parameter text for the action specified. (eg the filename for RUN, string representing a host command for HOSTCMD). If specified, 'action' must also be specified.
description (optional) - Used to give a brief description of the function key purpose. If specified, 'action' and 'action_text' must be specified.
Return Value None
Errors This keyword does not set the error flag.
Example
@STRING EXE_DIR = ""
@SAVEDIR(EXE_DIR)
@EXE_DIR = COPY(EXE_DIR,1,POS("\",EXE_DIR,LAST))

@FUNKEY(15,"T",CONCAT(EXE_DIR,"SCRIPTS\CONNECT.CMD"),"Run connect script")
@FUNKEY(16,"L",#8,"Emulate a backspace in the terminal pane")
@FUNKEY(17,"S",#13,"Send carriage return to connected host")
@FUNKEY(18,"A","allip;","AXE - Alarm Functions, Alarm List, Print")
@PAUSE

@FOR INTEGER i = 15 TO 20
    @FUNKEY(i)                 ! clear all function key actions added

Back to Top


GETALLMODES

Description Returns all modes supported by the application. See also @MODE, @GETMODE and modes Note: As the variables used as parameters are passed by reference, any existing values they stored will be overwritten.
Support Wozterm
Syntax GETALLMODES ( int var, 1 dimensional str array )
Usage GETALLMODES ( num_modes, mode_names )
Parameters num_modes - Name of defined INTEGER variable that will store the number of modes that the application supports.
mode_names - Name of defined STRING array variable that will store the name of each mode that the application supports.
Return Value BOOLEAN - TRUE if all modes have been retrieved, otherwise FALSE.
Errors The error flag is set if the size of the array variable provided, 'mode_names', is not large enough to store the name of each mode supported by the application.
Example
@INTEGER num_modes
@STRING modes[30]
@CHECK(OFF)
@BOOLEAN result = GETALLMODES(num_modes,modes)
@CHECK(ON)
@IF NOT result THEN GOTO TooMany
@INTEGER choice = -1
@MENUARRAY(choice,0,"Choose a new mode",num_modes,modes)
@IF choice <> 0 THEN
@BEGIN
    @MODE(modes[choice])
    @COMMENT("MODE has been changed to: ",GETMODE())
@END
@STOP

@LABEL TooMany
@COMMENT("Unable to return all modes supported by application")
@STOP

Back to Top


@GETDATE

Category Date & Time Functions
Description Returns the current PC date and time, and optionally the number of the day of week. In OZI (Ozterm6 Interpreter) mode this keyword may be used as either a command or a function.
When used as a command (@GETDATE):
The date/time string is returned within the string variable supplied as the first parameter in the format YYYYMMDDhhmmssdow. The optional integer variable parameter is used to return the number of the day of the week.
When used as a function (GETDATE() - OZI mode only):
The date/time string is the return value
Note: as the variables used as parameters are passed by reference any existing values they store will be overwritten.
Support Wozterm and Wozix
Syntax @GETDATE ( str var [, int var] )
Usage @GETDATE ( date_time [ , day_num ] ), or (OZI only) GETDATE [ ( [day_num] ) ]
Parameters date_time - Name of defined STRING variable that will store the current date.
day_num (optional) - Name of defined INTEGER variable that will store the number of the day of the week (ie 0 (Sunday) through to 6 (Saturday)).
Return Value None
Errors This keyword does not set the error flag.
Example
@STRING date_time
@INTEGER day_num
@GETDATE(date_time,day_num)
@comment("Today's date is ",date_time)
@comment("It is the ",day_num," day of the week")

Back to Top


GETDATETIME

Category Date & Time Functions
Description Function returning the current PC date and time including milliseconds , optionally offset by the specified number of milliseconds. The date/time string is returned in the format YYYYMMDDhhmmssxxx where 'xxx' is the milliseconds.
Support Wozterm and Wozix
Syntax GETDATETIME ( [int exp] )
Usage GETDATETIME ( [ msec_offset ] )
Parameters msec_offset (optional) - Millisecond offset that is to be applied to the current date/time before it is returned. Can be a positive, 0, or negative numeric value.
Return Value STRING - The current date and time, with offset if supplied.
Errors This keyword does not set the error flag.
Example
@STRING now = GETDATETIME()
@COMMENT("The current date and time is ",now)
@STRING minute_ahead = GETDATETIME(60*1000)
@COMMENT("In one minute the date and time will be ",minute_ahead)
@STRING half_hour_behind = GETDATETIME(-30*60*1000)
@COMMENT("Half an hour ago the time was ",half_hour_behind)

Back to Top


GETDAY

Category Date & Time Functions
Description Returns name of the day for the current OR optionally a specified date. The optional second parameter is an integer variable used to return the number of the day of the week.
Note: As the variable used as the parameter is passed by reference, any existing value it stored will be overwritten.
Support Wozterm and Wozix
Syntax GETDAY ( [str exp [, int var]] )
Usage GETDAY ( [ date_time [ , day_num ] ] )
Parameters date_time (optional) - Date for which to obtain the name of the day, as a correctly formatted date string.
day_num (optional) - Name of defined INTEGER variable that will store the number of the day of the week (ie 0 (Sunday) through to 6 (Saturday)).
Return Value STRING - Name of the day (Sun,Mon,Tue,Wed,Thu,Fri,Sat).
Errors The error flag is set if the 'date_time' string is not in a recognised format.
Example
@STRING  day_name
@INTEGER day_num
@SET day_name = GETDAY()
@COMMENT("Today is a ",day_name,".")
@SET day_name = GETDAY("20000101")
@COMMENT("New Year's day in 2000 was a ",day_name,".")
@INTEGER year = INT(COPY(GETDATETIME(),1,4))
@INC(year)
@SET day_name = GETDAY(CONCAT(STR(year),"0101"),day_num)
@DISPLAY("New Year's day next year will be a ",day_name,",")
@IF (day_num > 4) THEN
    @COMMENT(" will have the weekend to recover.")
@ELSE
    @COMMENT(" back to work the next day.")

Back to Top


GETDEST

Category Communication Functions
Description Returns network element name for the connected host , or the value set by @SETDEST.
Support Wozterm and Wozix
Syntax GETDEST ( )
Usage GETDEST ( )
Parameters None
Return Value STRING - Network element name.
Errors This keyword does not set the error flag.
Example
@STRING dest = GETDEST()
@IF dest <> "" THEN
@BEGIN
    @WINDOW
        @COMMENT("Disconnecting from, ",dest,".")
        @DELAYSEC(2)
    @WINDEND
    @DISCONNECT(dest)
@END
@ELSE
    @COMMENT("Not currently connected.")

Back to Top


@GETDIR

Category File / Disk Handling Functions
Description Returns current working directory. In OZI (Ozterm6 Interpreter) mode this keyword may be used as either a command or a function.
When used as a command (@GETDIR):
The current working directory path is returned within the string variable supplied as the parameter
When used as a function (GETDIR() - OZI mode only):
The current working directory path is the return value
Note: as the variables used as parameters are passed by reference any existing values they store will be overwritten. See also @CHDIR, @MACHINEDIR, @MKDIR, @PROGRAMDIR, @RMDIR, @SAVEDIR, @SESSIONDIR and @USERDIR.
Support Wozterm and Wozix
Syntax @GETDIR ( str var )
Usage @GETDIR ( current_dir ), or (OZI only) GETDIR[()]
Parameters current_dir - Name of defined STRING variable that will store the current working directory.
Return Value None
Errors This keyword does not set the error flag.
Example
@STRING curr_dir
@GETDIR(curr_dir)
@COMMENT("current directory is " + curr_dir)

Back to Top


GETENV

Category Program Handling Functions
Description Returns value of an operating system environment variable.
Support Wozterm and Wozix
Syntax GETENV ( str exp )
Usage GETENV(env_var_name)
Parameters env_var_name - The name of which environment variable to retrieve it's current value.
Return Value STRING - Environment variable value
Errors The error flag will be set if the 'env_var_name' specified is not currently set.
Example
@COMMENT("Path is ",GETENV("path"))

Back to Top


GETEPOCH

Category Date & Time Functions
Description Returns the current Unix epoch timestamp
Support Wozterm and Wozix
Syntax GETEPOCH ( )
Usage @int epoch = GETEPOCH ()
Parameters None
Return Value INTEGER - Unix epoch timestamp
Errors This keyword does not set the error flag.
Example
No example script segment available

Back to Top


GETERRORFLAG

Category Program Handling Functions
Description Returns the state of the error flag, optional parameters return error number and error string. In OZI (Ozterm6 Interpreter) mode this keyword may be used as either a command or a function. When used as a command (@GETERRORFLAG - OZI mode only):
The current state of the error flag is returned within the variable supplied as the first parameter, the error number is returned in the second parameter and the corresponding error description is returned in the third parameter.
When used as a function (GETERRORFLAG()):
The current state of the error flag is the return value, the error number is returned in the second parameter and the corresponding error description is returned in the third parameter.
Note: as the variables used as parameters are passed by reference any existing values they store will be overwritten.
Note: This does not reset the error flag. See also @SETERRORFLAG and @IFERROR.
Support Wozterm and Wozix
Syntax GETERRORFLAG ( [int var [, str var]] )
Usage @GETERRORFLAG([error_number[, error_string]]) or (OZI only) GETERRORFLAG[(error_number[, error_string])]
Parameters error_number (optional) - The name of the INTEGER variable to return the error number.
error_string (optional) - The name of the STRING variable to return the error string associated with the 'error_number'.
Return Value BOOLEAN - True if error flag is set
Errors This keyword does not set the error flag.
Example
Script Example
**************
@CHECK(off)
@INTEGER x = 0
@INTEGER errNum
@STRING errText
@set x = 5/x
@IF GETERRORFLAG(errNum,errText) THEN
@BEGIN
    @COMMENT("Error Number is ", errNum)
    @COMMENT("Error Text is ", errText)
@END

Produces Output
***************

Error Number is 507
Error Text is OVM: Divide by zero

Back to Top


GETEVENTLOG

Category File / Disk Handling Functions
Description Returns name of current event log file , optional parameter returns if it is open. See also TEXTEVSET.
Support Wozterm
Syntax GETEVENTLOG ( [bln var] )
Usage GETEVENTLOG ( [ event_open ] )
Parameters event_open (optional) - BOOLEAN variable indicating whether the file is open if TRUE, or closed if FALSE.
Return Value STRING - Event File name.
Errors This keyword does not set the error flag.
Example
@boolean open
@string eventlog
@set eventlog = GETEVENTLOG(open)
@display("Event log file is '",eventlog,"'")
@if open then comment(", which is open")
@else comment(", which is closed")

Back to Top


GETHEADER

Category Communication Functions
Description Returns last network element port header.
Support Wozterm and Wozix
Syntax GETHEADER ( )
Usage GETHEADER()
Parameters None
Return Value STRING - Port header
Errors This keyword does not set the error flag.
Example
@string xhead = GETHEADER()
@IF pos(" MTP ",xhead) > 0 THEN comment('Connected to an MTP Session')

Back to Top


GETLOG

Category File / Disk Handling Functions
Description Returns name of current terminal log file , optional boolean parameter returns if open or not. See also @LOG.
Support Wozterm and Wozix
Syntax GETLOG ( [bln var] )
Usage GETLOG( [ log_open ] )
Parameters log_open (optional) - BOOLEAN variable returning TRUE if the log file is open, FALSE if closed.
Return Value STRING - File name
Errors This keyword does not set the error flag.
Example
@log('log1.log')
@boolean open
@string log_file = GETLOG(open)
@display("log file is '",log_file,"'")
@if open then comment(", which is open")
@else comment(", which is closed")
@close
@set log_file = GETLOG(open)
@display("log file is '",log_file,"'")
@if open then comment(", which is open")
@else comment(", which is closed")

Back to Top


GETMODE

Category Communication Functions
Description Returns current session mode. See also @MODE, @GETALLMODES and modes
Support Wozterm and Wozix
Syntax GETMODE ( )
Usage GETMODE()
Parameters None
Return Value STRING - Mode name
Errors This keyword does not set the error flag.
Example
@COMMENT("The current mode is ",GETMODE())

Back to Top


GETNAME

Category File / Disk Handling Functions
Description Returns name of the current script file including the directory path.
Support Wozterm and Wozix
Syntax GETNAME ( )
Usage GETNAME()
Parameters None
Return Value STRING - File name
Errors This keyword does not set the error flag.
Example
@COMMENT("The current script file is ",GETNAME())

Back to Top


GETPASSWORD

Category Communication Functions
Description Returns the password for the current mode or if parameter provided the mode specified. See also @SETPASSWORD.
Support Wozterm and Wozix
Syntax GETPASSWORD ( [str exp] )
Usage GETPASSWORD( [ mode ] )
Parameters mode (optional) - Specific mode name, may be other than current mode.
Return Value STRING - Password for mode
Errors Error flag is set if the mode password is not set.
Example
@check(off)
@display("The current mode ",GETMODE())
@string pword = GETPASSWORD()
@IFERROR then comment(" password is not set")
@else comment(" password is ",pword)

Back to Top


GETPORT

Category Deprecated Functions
Description Deprecated DOS Ozterm keyword.
Support This DOS Ozterm keyword has been deprecated - it is NOT supported.
Syntax N/A
Usage N/A
Parameters N/A
Return Value N/A
Errors This command will result in a compile error if used.
Example
N/A

Back to Top


GETPRINT

Category File / Disk Handling Functions
Description (NOT YET SUPPORTED) Returns current printer number.
Support Wozterm and Wozix
Syntax GETPRINT ( )
Usage GETPRINT()
Parameters None
Return Value INTEGER - Printer number
Errors This keyword does not set the error flag.
Example
No example script segment available

Back to Top


GETSCHED

Category Date & Time Functions
Description Returns the date and time when the current script is scheduled to run. See also @TIMEEVSET.
Support Wozterm
Syntax GETSCHED ( )
Usage GETSCHED()
Parameters None
Return Value STRING - The date and time the script file is set to run. 0 will be returned if this script file is not time triggered.
Errors This keyword does not set the error flag.
Example
@set integer result = TIMEEVSET("go", ADVANCE(GETSCHED(),'1m'))

Back to Top


GETSESSVARS

Category Program Handling Functions
Description Populates the specified array with the session variables. See also session variable definition, @FLUSHALL and @FLUSHVAR.
Support Wozterm and Wozix
Syntax GETSESSVARS ( 2 dimensional str array )
Usage GETSESSVARS(array)
Parameters array - Two dimensional array to store the name and value of the session variables. The second dimension of the array must equal 2.
Return Value INTEGER - Number of session variables that could not fit in the array
Errors This keyword does not set the error flag.
Example
@integer leftover
@string array[3,2]
@set {"sess1"} ='one'
@set {"sess2"} ='two'
@set {"sess3"} ='three'
@set {"sess4"} ='four'
@set {"sess5"} ='five'
@set leftover = GETSESSVARS(array)

@for integer index = 1 to 3
  @comment('Session variable ',array[index,1],' = ',array[index,2])

@comment('There are ',leftover,' session variables left over')

Back to Top


GETUSERNAME

Category Communication Functions
Description Returns the user name for the current mode or if parameter provided the mode specified. See also @SETUSERNAME.
Support Wozterm and Wozix
Syntax GETUSERNAME ( [str exp] )
Usage GETUSERNAME( [ mode ])
Parameters mode (optional) - Specific mode name, may be other than current mode.
Return Value STRING - User name for mode
Errors Error flag is set if the mode User name is not set.
Example
@check(off)
 @display("The current mode ",GETMODE())
 @string user = GETUSERNAME()
 @IFERROR then comment(" user name is not set")
 @else comment(" user name is ",user)

Back to Top


@GOSUB

Category Program Handling Functions
Description Used to invoke a subroutine contained within the same file or library file. A @GOSUB statement may appear prior to the definition of the subroutine it is invoking. See also @SUBROUTINE and @SUBROUTINEREF.
Support Wozterm and Wozix
Syntax @GOSUB subroutine_name
Usage @GOSUB subroutine_name
Parameters subroutine_name - Name of the subroutine that is to be invoked. Either a literal or SUBROUTINEREF.
Return Value None
Errors This keyword does not set the error flag.
Example
@SUBROUTINE HelloWorld
@BEGIN
    @COMMENT("Hello World")
@END

@GOSUB HelloWorld
@COMMENT("Continue with rest of the script file ....")

Back to Top


@GOTO

Category Program Handling Functions
Description Used to jump to and continue execution after a specified label within the file. The label can be defined before or after any @GOTO's that use it but must be in scope. See also @LABEL
Support Wozterm and Wozix
Syntax @GOTO ( label )
Usage @GOTO label
Parameters label - Name of the label to jump to.
Return Value None
Errors This keyword does not set the error flag.
Example
@COMMENT("this comment will print")
@GOTO there
@COMMENT("this comment will not print")
@LABEL there
@COMMENT("this comment will print")

Back to Top


HEX

Category Data Manipulation Functions
Description Returns hexadecimal string of an integer value. Optional parameter restricts number of digits returned.
Note: If a negative number is to be converted, the resultant hex string will be in hexadecimal 2's complement. The @DECIMAL function will NOT be able to convert this back to the original value.
ie Parameter of -760 (760 = 2F8 in hexadecimal)
  FFFFFFFF     From FFFFFFFF
        - 000002F8     Subtract the positive hex value
          FFFFFD07
        + 00000001     Then add one
          FFFFFD08     Resultant hex string
Support Wozterm and Wozix
Syntax HEX ( int exp [, int exp] )
Usage HEX ( decimal_num [ , length ] )
Parameters decimal_num - Decimal number to be converted to Hexadecimal.
length (optional) - The number of characters required for the resultant hex number (0-8) the default is 4.
Return Value STRING - Hexadecimal number equivalent to parameter
Errors This keyword does not set the error flag.
Example
@COMMENT("Signed hex representation of 255 is ",HEX(255))
@COMMENT("Signed hex representation of 255 restricted to 2 digits is ",HEX(255,2))

Back to Top


@HIDE

Category Screen / Input / Output Functions
Description Hides user script file window.
See Also @UNHIDE, @HIDETERM, @UNHIDETERM, @HIDECMDHIST, @UNHIDECMDHIST
Support Wozterm
Syntax @HIDE
Usage @HIDE
Parameters None
Return Value None
Errors This keyword does not set the error flag.
Example
@INTEGER i
@HIDE
@FOR i = 10 DOWNTO 1
@BEGIN
	@COMMENT("Script window will be hidden for ", i, " seconds")
	@delaysec(1)
@END
@unhide
@FOR i = 10 DOWNTO 1
@BEGIN
	@COMMENT("Script window will be back up for ", i, " seconds")
	@delaysec(1)
@END

Back to Top


@HIDECMDHIST

Category Screen / Input / Output Functions
Description Hides command history.
See Also @UNHIDECMDHIST, @HIDE, @UNHIDE, @HIDETERM, @UNHIDETERM
Support Wozterm and Wozix
Syntax @HIDECMDHIST
Usage @HIDECMDHIST
Parameters None
Return Value None
Errors This keyword does not set the error flag.
Example
@INTEGER i
@HIDECMDHIST
@FOR i = 10 DOWNTO 1
@BEGIN
	@COMMENT("Command History will be hidden for ", i, " seconds")
	@delaysec(1)
@END
@UNHIDECMDHIST

Back to Top


@HIDETERM

Category Screen / Input / Output Functions
Description Hides terminal window.
See Also @UNHIDETERM, @HIDE, @UNHIDE, @HIDECMDHIST, @UNHIDECMDHIST
Support Wozterm and Wozix
Syntax @HIDETERM
Usage @HIDETERM
Parameters None
Return Value None
Errors This keyword does not set the error flag.
Example
@UNHIDE
@UNHIDETERM
@COMMENT("The terminal window will disappear for 5 seconds")
@DELAYSEC(1)
@HIDETERM
@DELAYSEC(5)
@UNHIDETERM

Back to Top


HIGH

Category Screen / Input / Output Functions
Description Used by @DRAW as a sub-command to make following text appear highlighted.ie Yellow on Blue. Applicable to text displayed in the @WINDOW window using the @DRAW command. See also @INV and @LOW.
Support Wozterm
Syntax @DRAW ( HIGH )
Usage @DRAW ( HIGH, 'Highlighted Text' )
Parameters None
Return Value None
Errors This keyword does not set the error flag.
Example
@WINDOW(ON)
    @DRAW("Normal Text ",HIGH,"Highlighted Text")
    @DELAYSEC(10)
@WINDEND

Back to Top


@HOSTCMD

Category Communication Functions
Description Sends a command to a host / network element and waits for command to complete.
Support Wozterm and Wozix
Syntax @HOSTCMD ( [, exp...] )
Usage @HOSTCMD(command_to_send [, parameters ] )
Parameters command_to_send - The host command to be sent.
parameters (optional) - The host command parameters to be sent, if not already part of 'command_to_send'.
Return Value None
Errors The error flag is set if the response indicates the command failed, depending on the current mode.
Example
@MODE ("NEM AXE")
@CONNECT("ADLJ")
@HOSTCMD("STRSP:","R=ALL;")
@DISCONNECT

Back to Top


@HOSTCMDTIMEOUT

Category Communication Functions
Description Sets the total timeout in seconds for host commands to complete. Optional parameter sets the response inactivity timeout in seconds.
Support Wozterm and Wozix
Syntax @HOSTCMDTIMEOUT ( int exp [, int exp] )
Usage @HOSTCMDTIMEOUT(total_time [, inactivity_time ] )
Parameters total_time - Maximum time in seconds allowed for the response to host command to be completed, ie. the total time allowed for the command to be entered and the final response received.
inactivity_time (optional) - Maximum time in seconds allowed for no activity on the port connection, ie. no response after the command has been entered. This timer is reset each time any response is received.
Return Value None
Errors Error flag set if either timer expires.
Example
@HOSTCMDTIMEOUT(4*60*60, 30*60)       ! Command timeout is 4 hrs, inactivity timeout is 30 min

Back to Top


@IF

Category Program Handling Functions
Description Evaluates a boolean expression to conditionally execute code. The command (or command block) will only be executed if the conditional expression returns TRUE. Use an @ELSE command in conjunction with @IF to execute commands if the conditional expression returns false. See also NOT, OR, AND and XOR.
Support Wozterm and Wozix
Syntax @IF bln exp THEN
[ @BEGIN ]
...
[ @END ]
[ @ELSE
[ @BEGIN ]
...
[ @END ] ]
Usage @IF condition THEN code [ ELSE code ]
Parameters condition - The condition must evaluate to a boolean result. Usually it consists of a relative comparison of two expressions. Conditionals allowed are "<", "<=", "=", "<>", ">=", ">". Compound conditional expressions can be assembled using brackets and the logical operators AND, OR and XOR. A condition can be negated with the logical NOT operator.
code - Instruction (or instructions with @BEGIN ... @END) that does something, eg SET, GOTO, GOSUB or even another @IF statement.
Return Value None
Errors This keyword does not set the error flag.
Example
@INTEGER first = RANDOM(3)
@INTEGER second = RANDOM(3)

@IF (first = 1) THEN
@BEGIN
    @IF (second = 1) THEN
        @COMMENT("The number generated was 11")
    @ELSE IF (second = 2) THEN
        @COMMENT("The number generated was 12")
    @ELSE
        @COMMENT("The number generated was 13")
@END
@ELSE IF (first = 2) THEN
@BEGIN
    @IF (second = 1) THEN
        @COMMENT("The number generated was 21")
    @ELSE IF (second = 2) THEN
        @COMMENT("The number generated was 22")
    @ELSE
        @COMMENT("The number generated was 23")
@END
@ELSE
@BEGIN
    @IF (second = 1) THEN
        @COMMENT("The number generated was 31")
    @ELSE IF (second = 2) THEN
        @COMMENT("The number generated was 32")
    @ELSE
        @COMMENT("The number generated was 33")
@END

Back to Top


@IFERROR

Category Program Handling Functions
Description Evaluates and resets the runtime error flag to conditionally execute code. The command (or command block) will only be executed if the error flag is set. Used in conjunction with @CHECK to error check commands and statements that are able to set the error flag. Use an @ELSE command in conjunction with @IFERROR to execute command (or command block) if the error flag is not set. See also @TRAP, @SETERRORFLAG and @GETERRORFLAG.
Support Wozterm and Wozix
Syntax @IFERROR THEN
[ @BEGIN ]
...
[ @END ]
[ @ELSE
[ @BEGIN ]
...
[ @END ] ]
Usage @IFERROR THEN code [ ELSE code ]
Parameters code - Instruction (or instructions with @BEGIN ... @END) that does something, eg SET, GOTO, GOSUB or even another @IF statement.
Return Value None
Errors This command clears the error flag.
Example
@INTEGER one = 1, zero = 0, result
@CHECK(OFF)
@SET result = one / zero
@IFERROR then
@BEGIN
    @COMMENT("Attempt to divide by 0")
    @STOP
@END
@ELSE
    @COMMENT("Result = ",result)

Back to Top


@INC

Category Data Manipulation Functions
Description Increment the value of an integer variable optionally by a specified amount (default is 1). When incrementing, and decrementing integer variables by 1 it is preferable to use @INC, and @DEC as the OVM compiler will generate faster code than if an equivalent @SET command was used.
Support Wozterm and Wozix
Syntax @INC ( int var [, int exp] )
Usage @INC ( var_name [, amount ] )
Parameters var_name - Name of defined INTEGER variable to be incremented.
amount (optional) - Used to set the amount to increment by. If not specified, the variable is incremented by 1.
Return Value None
Errors This keyword does not set the error flag.
Example
@INTEGER count = 50

@LABEL PLUS1
@IF count <> 60 THEN
@BEGIN
    @COMMENT(count)
    @INC(count)
    @GOTO PLUS1
@END

@LABEL PLUS5
@IF count <= 100 THEN
@BEGIN
    @COMMENT(count)
    @INC(count,5)
    @GOTO PLUS5
@END

Back to Top


@INCLUDE

Category Program Handling Functions
Description Calls another script file at runtime.
Returns to the original file at the line following the INCLUDE statement when end-of-file or @EOSUB is encountered.
Optional parameter specifies start label. If label is specified then will search the specified file for label and start running the script from that point. If the specified Label is not found, the transmitter returns to the "host" file without running the "included" script file.
Other optional arguments may be specified which will be passed to the "included" file. See also @RUN, A HREF="#ARGCOUNT">@ARGCOUNT and @ARGVALUE.
Support Wozterm and Wozix
Syntax @INCLUDE ( str exp [, matching exp...] )
Usage @INCLUDE(file_name [, label_name, [argument 1, [...] ] ] )
Parameters file_name - Name of the file to be called. If no path is specified then the file to be included will be searched for in the current working directory, then any directories specified in the [PATHS] section in Wozterm.ini.
label_name (optional) - Label name to jump to in the included file.
argument 1 ... (optional) - Arguments to be passed to the "Included" file.
Return Value None
Errors Error flag set if the file to be included, or the optional label name, cannot be found.
Example
! File1.cmd
! This file will include File2.cmd
@COMMENT("In file1.cmd")
@INCLUDE("file2.cmd","Start","arg1")
@COMMENT("Back in file1.cmd")
@PAUSE

!------------------------------------------------------------
! File2.cmd
! This file will be included at runtime by file1.cmd
@Label Start
  @COMMENT("In file2.cmd")
  @comment("Number of arguments = ",argcount())
  @FOR INTEGER i = 1 to ARGCOUNT()
    @COMMENT("Argument ",i," = ",ARGVALUE(i))
@EOSUB

Back to Top


INHISTORY

Category Date & Time Functions
Description Indicates if a date/time is in the past.
Support Wozterm and Wozix
Syntax INHISTORY ( str exp )
Usage INHISTORY(date_time)
Parameters date_time - Date/time to test if it is in the past or not, as a correctly formatted date string.
Return Value BOOLEAN - TRUE if in past.
Errors This keyword does not set the error flag.
Example
! output should be "That's so last century"
@IF INHISTORY("19660503") THEN COMMENT("That's so last century")
@ELSE COMMENT("not in history")

Back to Top


@INKEY

Category Screen / Input / Output Functions
Description Waits for and retrieves a user keystroke. May be displayed with an optional prompt.
Support Wozterm
Syntax @INKEY ( [str var [, str exp]] )
Usage @INKEY( [key_name [, prompt_text]] )
Parameters key_name (optional) - Stores the key that the user pressed. If not specified the key pressed is not saved. Must be specified if prompt_text is specified.
prompt_text (optional) - Prompt text to request a particular key, etc from the user.
Return Value None
Errors This keyword does not set the error flag.
Example
@string key
@INKEY(key,'Press any key to continue')

Back to Top


@INPUT

Category Screen / Input / Output Functions
Description Requests a string from the user. Optional parameters are a prompt and whether to obfuscate display for passwords, etc.
Support Wozterm and Wozix
Syntax @INPUT ( str var [, str exp [, bln exp]] )
Usage @INPUT(input_data [, prompt_text [, obfuscate)]])
Parameters input_data - String variable that will store the text user enters.
prompt_text (optional) - Text to prompt for particular user input.
obfuscate (optional) - If set to true, asterisks are echoed rather than text entered
Return Value None
Errors This keyword does not set the error flag.
Example
@STRING username = "", password = ""
@STRING usernamePrompt = "Please enter your User Name"
@STRING passwordPrompt = "Please enter your password"

@LABEL INPUTNAME
@INPUT(username, usernamePrompt)
@IF username = "" THEN
@BEGIN
	@usernamePrompt = "User Name cannot be blank...please re-enter"
	@GOTO INPUTNAME
@END

@LABEL INPUTPASSWORD
@INPUT(password, passwordPrompt, true)
@IF password = "" THEN
@BEGIN
	@passwordPrompt = "Password cannot be blank...please re-enter"
	@GOTO INPUTPASSWORD
@END

@COMMENT("Your name is ", username)
@COMMENT("and your password is secret")

Back to Top


INSET

Category Data Manipulation Functions
Description Test if the first value is matched by any of the listed values.
Note: Arrays as a whole cannot be compared, but array elements are fine.
Support Wozterm and Wozix
Syntax INSET ( exp [, matching exp...] )
Usage INSET(value_to_test, test_value [, test_value [, ...]])
Parameters value_to_test - First parameter is the value which you are looking to match with any of the following parameters .
test_value - One or more values to test the first parameter against. They must be of the same type and may be array elements but not arrays as a whole.
Return Value BOOLEAN - TRUE if matching value found
Errors This keyword does not set the error flag.
Example
!compare string values
@STRING strToTest = "bell", strVal1 = "bell", strVal2 = "bell", strVal3 = "horn"

@IF INSET(strToTest, strVal1) THEN COMMENT("strToTest, strVal1 : Got Match")
@ELSE COMMENT("strToTest, strVal1 : No Match")

@IF INSET(strToTest, strVal1, strVal2) THEN COMMENT("strToTest, strVal1, strVal2 : Got Match")
@ELSE COMMENT("strToTest, strVal1, strVal2 : No Match")

@IF INSET(strToTest, strVal2, strVal3) THEN COMMENT("strToTest, strVal2, strVal3 : Got Match")
@ELSE COMMENT("strToTest, strVal2, strVal3 : No Match")

@IF INSET(strToTest, strVal3) THEN COMMENT("strToTest, strVal3 : Got Match")
@ELSE COMMENT("strToTest, strVal3 : No Match")
@COMMENT()

!compare integers
@INTEGER intToTest = 0, intVal1 = 0, intVal2 = 0, intVal3 = 1

@IF INSET(intToTest, intVal1) THEN COMMENT("intToTest, intVal1 : Got Match")
@ELSE COMMENT("intToTest, intVal1 : No Match")

@IF INSET(intToTest, intVal1, intVal2) THEN COMMENT("intToTest, intVal1, intVal2 : Got Match")
@ELSE COMMENT("intToTest, intVal1, intVal2 : No Match")

@IF INSET(intToTest, intVal2, intVal3) THEN COMMENT("intToTest, intVal2, intVal3 : Got Match")
@ELSE COMMENT("intToTest, intVal2, intVal3 : No Match")

@IF INSET(intToTest, intVal3) THEN COMMENT("intToTest, intVal3 : Got Match")
@ELSE COMMENT("intToTest, intVal3 : No Match")
@COMMENT()

!compare booleans
@BOOLEAN boolToTest = TRUE, boolVal1 = TRUE, boolVal2 = TRUE, boolVal3 = FALSE

@IF INSET(boolToTest, boolVal1) THEN COMMENT("boolToTest, boolVal1 : Got Match")
@ELSE COMMENT("boolToTest, boolVal1 : No Match")

@IF INSET(boolToTest, boolVal1, boolVal2) THEN COMMENT("boolToTest, boolVal1, boolVal2 : Got Match")
@ELSE COMMENT("boolToTest, boolVal1, boolVal2 : No Match")

@IF INSET(boolToTest, boolVal2, boolVal3) THEN COMMENT("boolToTest, boolVal2, boolVal3 : Got Match")
@ELSE COMMENT("boolToTest, boolVal2, boolVal3 : No Match")

@IF INSET(boolToTest, boolVal3) THEN COMMENT("boolToTest, boolVal3 : Got Match")
@ELSE COMMENT("boolToTest, boolVal3 : No Match")
@COMMENT()

!compare array elements
@INTEGER ARRAY1[3], ARRAY2[3]
@ARRAY2[2] = 1 ! this will have all elements matching except index 2

@FOR INTEGER i = 1 TO 3
@BEGIN
	@IF INSET(ARRAY1[i], ARRAY2[i]) THEN COMMENT("ARRAY1[",i,"] ARRAY2[",i,"] : Got Match")
	@ELSE COMMENT("ARRAY1[",i,"] ARRAY2[",i,"] : No Match")
@END

Back to Top


INT

Category Data Manipulation Functions
Description Convert a number represented as a string of digits to its integer value.
Support Wozterm and Wozix
Syntax INT ( str exp )
Usage INT(string_number)
Parameters string_number - A string of decimal digits to be converted to the corresponding integer value.
Return Value INTEGER - 0 if string doesn't represent a number (eg abc) or integer value of string
Errors This keyword does not set the error flag.
Example
@STRING testString = "abcdef"
@INTEGER testInt = INT(testString)
@COMMENT("Number is now ",testInt) ! outputs Number is now 0

@testString = "100"
@testInt = INT(testString)
@testInt = testInt + 100
@COMMENT("Number is now ",testInt) ! outputs Number is now 200

Back to Top


@INTEGER

Category Program Handling Functions
Description Used to define integer type variables and arrays. If not explicitly set the variable will be set with the compiler's default value of 0.
See also DEFAULTVALUE. For examples and further information on using variables, refer to Variables
Support Wozterm and Wozix
Syntax @INTEGER var_name [ [ DEFAULTVALUE ] = int exp ]
Usage @INTEGER var_name [ [ DEFAULTVALUE ] = value ]
Parameters var_name - The name to assigned to the variable or array consisting of up to 30 characters (a - z, A - Z, _, 0 - 9) starting with a letter or an underscore.
DEFAULTVALUE (optional) - to assign a specific default value to the variable at compile time.
value (optional) - Literal, variable or expression which evaluates to a numeric value.
Return Value None
Errors This keyword does not set the error flag.
Example
@INTEGER num, nums[10]

@FOR num = 1 to 10
    @SET nums[num] = num * 10

Back to Top


INV

Category Screen / Input / Output Functions
Description Used by @DRAW as a sub-command to display inverse text.ie White on Red. Applicable to text displayed in the @WINDOW window using the @DRAW command. See also @HIGH and @LOW.
Support Wozterm
Syntax @DRAW ( INV )
Usage @DRAW ( INV, 'Inverted Text' )
Parameters None
Return Value None
Errors This keyword does not set the error flag.
Example
@WINDOW(ON)
    @DRAW("Normal Text ",INV,"Inverted Text")
    @DELAYSEC(10)
@WINDEND

Back to Top


KEYPRESS

Category Screen / Input / Output Functions
Description Ozterm script command checks for a key press. NOT recommended for Wozterm script files.
Only responds to standard ASCII (values up to 127) and F1-F10, Arrow keys, Insert, Home, Page Up, Page Down, Delete & End
Support Wozterm
Syntax KEYPRESS ( [int var] )
Usage KEYPRESS([key_pressed])
Parameters key_pressed (optional) - INTEGER variable stores the decimal ASCII value of the key pressed, eg A = 64.
Return Value BOOLEAN - TRUE if a key has been pressed.
Errors This keyword does not set the error flag.
Example
@set blinkon = "_"
@set blinkoff = " "
@set keyval = ""
@set blinking = blinkon
@window
@for timer = 40 DOWNTO 0
	@draw(INV,CUP,37,04,blinking,low,cup,52,05," or Timeout in ",high,timer/2+1,low," secs)")
	@for msec = 1 to 5
		@DEL5MSEC(20)
		@if KEYPRESS(keyval) then GOTO key_pressed
	@next msec
	@if blinking = blinkon then set blinking = blinkoff
	@else set blinking = blinkon
@next timer

@label key_pressed
@if msec < 5 then ENDFOR()
@if timer > 0 then ENDFOR()
@if inset(keyval,"",27,81,113) then GOTO end2
.....

@label end2
.....

Back to Top


@KEYTIMEOUT

Category Screen / Input / Output Functions
Description Sets time in seconds for user to cancel a pending time event. See "Set KEYTIMEOUT value" in the "Preferences" menu.
Support Wozterm
Syntax @KEYTIMEOUT ( int exp )
Usage @KEYTIMEOUT(time_in_seconds)
Parameters time_in_seconds - INTEGER value indicating the number of seconds to wait before a time event will run.
Return Value None
Errors This keyword does not set the error flag.
Example
@KEYTIMEOUT(20)

Back to Top


@LABEL

Category Program Handling Functions
Description Defines a label name that can be jumped to by certain script commands.
Commands which may use labels to define the point at which to continue, commence or check script execution are @ENDLOOP, @ENDFOR, @GOTO, @INCLUDE, @RUN, @EVDELETE, @EVLOADED, @EVSETPRI, @LABELREF, @TEXTEVSET and @TIMEEVSET.
Support Wozterm and Wozix
Syntax @LABEL label_name
Usage @LABEL label_name
Parameters label_name - The name to assigned to the label consisting of up to 30 characters (a - z, A - Z, _, 0 - 9) starting with a letter or an underscore.
Return Value None
Errors This keyword does not set the error flag.
Example
@LABEL START
@COMMENT('An endless loop...')
@GOTO START

Back to Top


@LABELREF

Category Program Handling Functions
Description Defines a reference to a label name for use with @GOTO. See also DEFAULTVALUE and @GOTO.
Support Wozterm and Wozix
Syntax @LABELREF label_ref [ DEFAULTVALUE ] [ = label_name ]
Usage @LABELREF label_ref [ DEFAULTVALUE ] [ = label_name ]
Parameters label_ref - The name to be assigned to the label reference consisting of up to 30 characters (a - z, A - Z, _, 0 - 9) starting with a letter or an underscore.
label_name - The name of a defined label that the label reference is to point to.
Return Value None
Errors This keyword does not set the error flag.
Example
@LABELREF num_type

@LABEL NEW_NUMBER
@INTEGER result, random_num = RANDOM(10)
@SET result = random_num % 2
@IF result = 1 THEN
    @SET num_type = IS_ODD
@ELSE
    @SET num_type = IS_EVEN
@GOTO num_type

@LABEL IS_ODD
@COMMENT("The random number generated ",random_num," is odd.")
@GOTO NEW_NUMBER

@LABEL IS_EVEN
@COMMENT("The random number generated ",random_num," is even.")
@STOP

Back to Top


LAST

Category Reserved Words
Description Used with POS and STRPOS to find the last occurrence of a substring in a string. See also POS and STRPOS.
Support Wozterm and Wozix
Syntax LAST
Usage POS(substring, string [, LAST ] )
Parameters None
Return Value INTEGER
Errors This keyword does not set the error flag.
Example
@INTEGER test = POS("ab", "abcdefabcdefabc", LAST)
@COMMENT(test)			! outputs 13

Back to Top


LENGTH

Category Data Manipulation Functions
Description Returns the length of a string (number of characters). Performs same function as STRLENGTH
Support Wozterm and Wozix
Syntax LENGTH ( str exp )
Usage LENGTH(str_exp)
Parameters str_exp - String to be tested for length.
Return Value INTEGER - Number of characters in string
Errors This keyword does not set the error flag.
Example
@INTEGER test = LENGTH("")
@COMMENT(test)			! outputs 0

@test = LENGTH("abcde")
@COMMENT(test)			! outputs 5

Back to Top


@LIBRARY

Category Program Handling Functions
Description Uniquely identifies a library name for a script file. This command must be the first command in any file referenced by an @USELIBRARYFILE command . The library name specified is checked at compile time to ensure that the same file has not been included more than once.
Note: It is not possible to specify more than one library name in a single script file, ie. maximum of one @LIBRARY command per file.
Support Wozterm and Wozix
Syntax @LIBRARY library_name (MUST be the first line of the file)
Usage @LIBRARY library_name
Parameters library_name - The name to assigned to the library consisting of up to 30 characters (a - z, A - Z, _, 0 - 9) starting with a letter or an underscore.
Return Value None
Errors This keyword does not set the error flag.
Example
! File: LibraryExample.cmd
@USELIBRARYFILE "MathsFunctions.lib"  ! Library file is used / compiled here

@INTEGER num = RANDOM(100)
@IF IsOdd(num) THEN
    @COMMENT(num," is an odd number.")
@ELSE
    @COMMENT(num," is NOT an odd number.")
@SET num = RANDOM(100)
@IF IsEven(num) THEN
    @COMMENT(num," is an even number")
@ELSE
    @COMMENT(num," is NOT an even number.")

@PAUSE

!------------------------------------------------------------
! File: MathsFunctions.lib
@LIBRARY MathsFunctions

@FUNCTION BOOLEAN IsEven(INTEGER num)
@BEGIN
    @SET IsEven = num % 2 = 0
@END

@FUNCTION BOOLEAN IsOdd(INTEGER num)
@BEGIN
    @SET IsOdd = num % 2 <> 0
@END

Back to Top


LOADXML

NB: This keyword is still being beta tested and is not available with the released version of Wozterm
Category Currently Beta Testing
Description Decodes XML data and pushes the data into session variables using a '.' separated string of the element paths as the key and the child text nodes as the values. The file must be open and been opened with @LOADXML.
Support Wozterm and Wozix
Syntax LOADXML ( str exp, 1 dimensional str array )
Usage LOADXML ( key_prefix, xml_data )
Parameters key_prefix - The prefix to apply to the session variable keys.
xml_data - A one dimensional array of strings containing the XML data.
Return Value BOOLEAN - True if XML file was parsed correctly, otherwise false
Errors The error flag is not used
Example
No example script segment available

Back to Top


@LOG

Category File / Disk Handling Functions
Description Enables data logging to the specified log file. See also CLOSE
Support Wozterm and Wozix
Syntax @LOG ( str exp )
Usage @LOG(log_filename)
Parameters log_filename - STRING indicating the log file name. If no path is specified, then will be created in the current working directory.
Return Value None
Errors This keyword does not set the error flag.
Example
@SET LGPATH = CONCAT(_logdrv,_logpath,"\LOG")
@MKDIR(LGPATH)
@set log_file = UPCASE(concat(LGPATH,"\NS_",LNCD,".LOG"))
@SET old_log = GETLOG(_open)
@CLOSE
@ERASE(log_file)
@LOG(log_file)
@check(OFF)
{COMM}
@CLOSE
@IF _open = 1 then LOG(old_log)

Back to Top


@LOGOF

Category Communication Functions
Description Logs off from the current network element (used in Ozterm script files). See LOGOFF.
Support Wozterm and Wozix
Syntax @LOGOF
Usage @LOGOF
Parameters None
Return Value None
Errors This keyword does not set the error flag.
Example
@LOGOF

Back to Top


@LOGOFF

Category Communication Functions
Description Logs off from the current network element. Only valid in Wozterm scripts. Fixes spelling of @LOGOF.
Support Wozterm and Wozix
Syntax @LOGOFF
Usage @LOGOFF
Parameters None
Return Value None
Errors This keyword does not set the error flag.
Example
@LOGOFF

Back to Top


@LOGON

Category Communication Functions
Description Requests a command prompt from the current network element. See also @CONNECT.
Support Wozterm and Wozix
Syntax @LOGON ( [str exp [, str exp [, str exp]]] )
Usage @LOGON [( username [, password [, new_password ]])]
Parameters username (optional) - User name to be used for this logon, ie other than the current default.
password (optional) - Password to be used for this logon, ie other than the current default.
new_password (optional) - New password to be used for this logon in case the password has expired, ie other than the current default.
Return Value None
Errors Error Flag is set if logon attempt failed.
Example
@LOGON

@LOGON(User_name, Password, New_password)

Back to Top


LOW

Category Screen / Input / Output Functions
Description Used by @DRAW as a sub-command to display normal intensity text, ie White on Blue. Applicable to text displayed in the @WINDOW window using the @DRAW command. See also @INV and @HIGH.
Support Wozterm
Syntax @DRAW ( LOW )
Usage @DRAW ( LOW, 'Regular Text' )
Parameters None
Return Value None
Errors This keyword does not set the error flag.
Example
@WINDOW
    @DRAW(HIGH,"Highlighted Text ",LOW,"Normal Text")
    @DELAYSEC(10)
@WINDEND

Back to Top


LOWCASE

Category Data Manipulation Functions
Description Returns the original string with all UPPER CASE characters converted to lower case. See also @UPCASE. Alias for STRLOWCASE
Support Wozterm and Wozix
Syntax LOWCASE ( str exp )
Usage LOWCASE(string_exp)
Parameters string_exp - String to be converted to lower case.
Return Value STRING - String in lower case
Errors This keyword does not set the error flag.
Example
@string mixed = 'AaBbcC1234_vV'
@comment(mixed)
@string lower = LOWCASE(mixed)
@comment(lower)

Back to Top


MACHINEDIR

Description Returns the MachineDataDirectory path of the application. This is where Wozterm's reference data files are stored, eg LOCAL.DAT, BMODULE.INI and connect data files. These files are common to all sessions and all users. See also @GETDIR, @USERDIR, @SAVEDIR, @SESSION, @MKDIR, @RMDIR, @CHDIR, @SESSIONDIR and @PROGRAMDIR. In OZI (Ozterm6 Interpreter) mode this keyword may be used as either a command or a function.
When used as a command (@MACHINEDIR - OZI mode only):
The path of the Wozterm data directory common to all users is returned within the variable
supplied as the parameter.
When used as a function (MACHINEDIR()):
The path of the Wozterm data directory common to all users is the return value.
Note: as the variables used as parameters are passed by reference any existing values they store will be overwritten.
Support Wozterm and Wozix
Syntax MACHINEDIR ( )
Usage @MACHINEDIR(string var) or (OZI mode only) MACHINEDIR[()]
Parameters None
Return Value STRING - MachineDataDirectory path
Errors This keyword does not set the error flag.
Example
@comment(MACHINEDIR())

Back to Top


@MARK

Category Communication Functions
Description Sets the starting search position for @SCAN. See also @SCAN.
Note: The SCAN start position is reset to the start of the latest command response each time a command is entered.
Support Wozterm and Wozix
Syntax @MARK ( [int exp] )
Usage @MARK[([ offset ])]
Parameters offset(optional) - INTEGER used to move the SCAN pointer in the terminal screen buffer forwards, or backwards using negative numbers.
Return Value None
Errors This keyword does not set the error flag.
Example
stdep:dev=li-100&&-130;
@integer len = REPLYLEN()
@integer line = scan("LI1-")
@string data = reply(line)
@MARK(line)
   @delaysec(1)

@label loop
   @set line = scan("LI1-")
   @set data = reply(line)
   @if line = 0 then GOTO endl
   @MARK(line)
   @set len = REPLYLEN()
   @delaysec(1)
@GOTO loop

@label endl
......

Back to Top


MEMAVAIL

Category File / Disk Handling Functions
Description Returns the physical memory (RAM) available.
Support Wozterm and Wozix
Syntax MEMAVAIL ( )
Usage MEMAVAIL()
Parameters None
Return Value INTEGER - Bytes available
Errors This keyword does not set the error flag.
Example
@integer mem = MEMAVAIL()
@comment(mem)

Back to Top


@MENU

Category Screen / Input / Output Functions
Description Displays a menu and waits for a user selection. See also @MENUARRAY
Support Wozterm
Syntax @MENU ( int var, int exp, str exp, str exp [, matching exp...] )
Usage @MENU(choice, timeout, title, menu_item [, menu_item [, ...]])
Parameters choice - INTEGER value used to store the choice selected by the user in the menu.
timeout - INTEGER timer value used to indicate the number of seconds to wait for user selection before timing out, 0 for no time out. If time-out occurs, the error flag will be set.
title - STRING value to be displayed at the top of the Menu.
menu_item - STRING value(s) to be displayed for each choice.
Return Value None
Errors Error flag is set if menu times out or is cancelled.
Example
@CLRSCR
@check(off)
@integer choice
@MENU(choice, 0, "Choose Option Below", "Selection 1", "Selection 2")	! menu with no timeout
@IFERROR then
@begin
	@comment("menu was cancelled")
@end
@else
	@comment(choice)
@MENU(choice, 20, "Choose Option Below", "Selection 1", "Selection 2")	! menu with timeout = 20
@IFERROR then
@begin
	@comment("menu timed out or was cancelled")
@end
@else
	@comment(choice)

Back to Top


@MENUARRAY

Category Screen / Input / Output Functions
Description Displays a menu and waits for a selection. Similar to @MENU but gets menu items from an array.
Support Wozterm
Syntax @MENUARRAY ( int var, int exp, str exp, int exp, 1 dimensional str array )
Usage @MENUARRAY(choice, timeout, title, num_items, menu_array)
Parameters choice - INTEGER value used to store the choice selected by the user in the menu.
timeout - INTEGER timer value used to indicate the number of seconds to wait for user selection before timing out, 0 for no time out. If the command times out, then the error flag will be set.
title - STRING value to be displayed at the top of the Menu.
num_items - INTEGER value indicating the number of items in the menu array.
menu_array - ARRAY containing the menu array element strings to be displayed as choices.
Return Value None
Errors Error flag is set if menu times out or is cancelled
Example
@check(off)
@integer choice
@string strArray[2]
@strArray[1] = "Selection 1"
@strArray[2] = "Selection 2"
@MENUARRAY(choice, 0, "Choose Option Below", 2, strArray)	! displays menu with no timeout
@IFERROR then
@begin
	@comment("menu was cancelled")
@end
@else
	@comment(choice)

@MENUARRAY(choice, 10, "Choose Option Below", 2, strArray) 	!displays menu with 10 second timeout
@IFERROR then
@begin
	@comment("menu timed out or was cancelled")
@end
@else
	@comment(choice)

Back to Top


@MKDIR

Category File / Disk Handling Functions
Description Creates a directory. See also @GETDIR, @MACHINEDIR, @CHDIR, @PROGRAMDIR, @RMDIR, @SAVEDIR, @SESSIONDIR and @USERDIR.
Support Wozterm and Wozix
Syntax @MKDIR ( str exp )
Usage @MKDIR(directory_path)
Parameters directory_path - The directory to be created.
Return Value None
Errors This keyword does not set the error flag.
Example
@MKDIR("log")

Back to Top


MOD

Category Data Manipulation Functions
Description Returns the remainder after integer division. Can also be written as '%'.
Support Wozterm and Wozix
Syntax int exp MOD int exp
Usage numerator MOD denominator
Parameters numerator - Number to be divided.
denominator - Number to divide by.
Return Value INTEGER - Remainder obtained when 'numerator' is divided by 'denominator'.
Errors Error flag is set if denominator is 0.
Example
@INTEGER remainder, a, b
@SET a = RANDOM(100)
@SET b = RANDOM(10)
@INC(a,b)
@SET remainder = a MOD b
@COMMENT("The remainder when ",a," is divided by ",b," is ",remainder,".")

Back to Top


@MODE

Category Communication Functions
Description Sets the session mode. See also @GETALLMODES, @GETMODE and modes.
Support Wozterm and Wozix
Syntax @MODE ( str exp )
Usage @MODE(mode_name)
Parameters mode_name - The mode required for the current session.
Return Value None
Errors This keyword does not set the error flag.
Example
@MODE("NEM S12")

Back to Top


@MSGCHANGEATTR

Category Message Functions
Description Changes the value of the last received message's attribute. See also @MSGGETATTR.
Support This OVM keyword is NOT supported by Wozterm or Wozix.
Syntax @MSGCHANGEATTR ( int exp, exp )
Usage @MSGCHANGEATTR(attribute_number, value)
Parameters attribute_number - The attribute number in the message to change, ie 1 - 5.
value - Value to change the message attribute to. Must match the original attribute value's type.
Return Value None
Errors This keyword does not set the error flag.
Example
@call MSGCHANGEATTR(1,newmode)

Back to Top


@MSGCREATE

Category Message Functions
Description Creates a new empty message.
Support This OVM keyword is NOT supported by Wozterm or Wozix.
Syntax @MSGCREATE ( int exp )
Usage @MSGCREATE(message type)
Parameters No parameter description available
Return Value None
Errors This keyword does not set the error flag.
Example
No example script segment available

Back to Top


@MSGFORWARD

Category Message Functions
Description Creates a new message with contents based on the last received message.
Support This OVM keyword is NOT supported by Wozterm or Wozix.
Syntax @MSGFORWARD ( int exp )
Usage @MSGFORWARD(new message type)
Parameters No parameter description available
Return Value None
Errors This keyword does not set the error flag.
Example
No example script segment available

Back to Top


MSGGETATTR

Category Message Functions
Description Gets the value of the last received message's attribute.
Support This OVM keyword is NOT supported by Wozterm or Wozix.
Syntax MSGGETATTR ( int exp, var )
Usage MSGGETATTR(attribute number)
Parameters No parameter description available
Return Value BOOLEAN - True if successful
Errors This keyword does not set the error flag.
Example
No example script segment available

Back to Top


MSGGETATTRSIZE

Category Message Functions
Description Returns the size in bytes of the last received message's attribute.
Support This OVM keyword is NOT supported by Wozterm or Wozix.
Syntax MSGGETATTRSIZE ( int exp )
Usage MSGGETATTRSIZE(attribute number)
Parameters No parameter description available
Return Value INTEGER - Size in bytes
Errors This keyword does not set the error flag.
Example
No example script segment available

Back to Top


MSGGETTYPE

Category Message Functions
Description Gets the type of the last received message (application dependent).
Support This OVM keyword is NOT supported by Wozterm or Wozix.
Syntax MSGGETTYPE ( )
Usage MSGGETTYPE
Parameters None
Return Value INTEGER - Type of message
Errors This keyword does not set the error flag.
Example
No example script segment available

Back to Top


MSGIDLE

Category Message Functions
Description Returns true if no messages are waiting to be received.
Support This OVM keyword is NOT supported by Wozterm or Wozix.
Syntax MSGIDLE ( )
Usage MSGIDLE
Parameters None
Return Value BOOLEAN - True if idle
Errors This keyword does not set the error flag.
Example
No example script segment available

Back to Top


MSGLOADATTR

Category Message Functions
Description Sets the contents of the outgoing message's attribute with the contents of a file.
Support This OVM keyword is NOT supported by Wozterm or Wozix.
Syntax MSGLOADATTR ( int exp, str exp )
Usage MSGLOADATTR(attribute number, file name)
Parameters No parameter description available
Return Value INTEGER - Number of bytes loaded
Errors This keyword does not set the error flag.
Example
No example script segment available

Back to Top


MSGNEXT

Category Message Functions
Description Gets (Receives) the next message. Optional parameter returns message type.
Support This OVM keyword is NOT supported by Wozterm or Wozix.
Syntax MSGNEXT ( [int var] )
Usage MSGNEXT([type variable name])
Parameters No parameter description available
Return Value BOOLEAN - True if successful
Errors This keyword does not set the error flag.
Example
No example script segment available

Back to Top


MSGNEXTOFTYPE

Category Message Functions
Description Gets (Receives) the next message of specified type.
Support This OVM keyword is NOT supported by Wozterm or Wozix.
Syntax MSGNEXTOFTYPE ( int exp )
Usage MSGNEXTOFTYPE(message type)
Parameters No parameter description available
Return Value BOOLEAN - True if successful
Errors This keyword does not set the error flag.
Example
No example script segment available

Back to Top


MSGSAVEATTR

Category Message Functions
Description Save the contents of the last received message's attribute to a file.
Support This OVM keyword is NOT supported by Wozterm or Wozix.
Syntax MSGSAVEATTR ( int exp, str exp )
Usage MSGSAVEATTR(attribute number, file name)
Parameters No parameter description available
Return Value INTEGER - Number of bytes saved
Errors This keyword does not set the error flag.
Example
No example script segment available

Back to Top


MSGSEND

Category Message Functions
Description Sends the last created message to the specified destination and returns immediately.
Support This OVM keyword is NOT supported by Wozterm or Wozix.
Syntax MSGSEND ( int exp )
Usage MSGSEND(destination)
Parameters No parameter description available
Return Value BOOLEAN - True if successful
Errors This keyword does not set the error flag.
Example
No example script segment available

Back to Top


MSGSENDBLOCKING

Category Message Functions
Description Sends the last created message to the specified destination and blocks execution.
Support This OVM keyword is NOT supported by Wozterm or Wozix.
Syntax MSGSENDBLOCKING ( int exp )
Usage MSGSENDBLOCKING(destination)
Parameters No parameter description available
Return Value BOOLEAN - True if successful
Errors This keyword does not set the error flag.
Example
No example script segment available

Back to Top


@MSGSETATTR

Category Message Functions
Description Sets the value of the last created message's attribute.
Support This OVM keyword is NOT supported by Wozterm or Wozix.
Syntax @MSGSETATTR ( int exp, exp )
Usage @MSGSETATTR(attribute number, INTEGER/BOOLEAN/STRING value)
Parameters No parameter description available
Return Value None
Errors This keyword does not set the error flag.
Example
No example script segment available

Back to Top


MSGWAIT

Category Message Functions
Description Waits for a message to become available to receive until timeout period (in milliseconds) expires.
Support This OVM keyword is NOT supported by Wozterm or Wozix.
Syntax MSGWAIT ( int exp )
Usage MSGWAIT(timeout in milliseconds)
Parameters No parameter description available
Return Value BOOLEAN - True if message available
Errors This keyword does not set the error flag.
Example
No example script segment available

Back to Top


@NEXTLOOP

Category Program Handling Functions
Description Used to immediately commence the next iteration in a loop. Can be used within @FOR, @REPEAT or @WHILE loops. See also @ENDLOOP.
Support Wozterm and Wozix
Syntax @NEXTLOOP
Usage @NEXTLOOP
Parameters None
Return Value None
Errors This keyword does not set the error flag.
Example
@INTEGER number = 0
@WHILE number < 10 DO
@BEGIN
    @INC(number)
    @IF (number % 3 = 0) THEN
        @NEXTLOOP
    @COMMENT(number," is not divisible by 3.")
@END

Back to Top


NONE

Category Reserved Words
Description Used with @BAUD to set parity to NONE. See also @BAUD, EVEN and ODD.
Support Wozterm and Wozix
Syntax NONE
Usage @BAUD(19200, 8, NONE)
Parameters None
Return Value INTEGER - 0
Errors This keyword does not set the error flag.
Example
@BAUD(9600,8,NONE)

Back to Top


NOT

Category Data Manipulation Functions
Description Boolean NOT operator, inverts the value of the boolean expression that follows it. The expression "NOT a" is equivalent to "a = FALSE". See also AND, OR and XOR.
Support Wozterm and Wozix
Syntax NOT bln exp
Usage NOT exp1
Parameters exp1 - Literal, variable or expression which evaluates to a boolean value (TRUE or FALSE).
Return Value BOOLEAN - The logical negation of the expression. TRUE if the expression evaluate to be FALSE, otherwise FALSE.
Errors This keyword does not set the error flag.
Example
@INTEGER number
@BOOLEAN done = FALSE
@WHILE NOT done DO
@BEGIN
    @SET number = RANDOM(20)
    @SET done = number < 10
    @IF NOT done THEN
        @COMMENT(number," is still greater than 9.")
@END

Back to Top


ODD

Category Reserved Words
Description Used with @BAUD to set parity to ODD. See also @BAUD, EVEN and NONE.
Support Wozterm and Wozix
Syntax ODD
Usage @BAUD(speed, bits, ODD)
Parameters None
Return Value INTEGER - 1
Errors This keyword does not set the error flag.
Example
@BAUD(19200, 8, ODD)

Back to Top


OFF

Category Reserved Words
Description Equivalent to boolean FALSE. See also @CHECK, FALSE and FAIL.
Support Wozterm and Wozix
Syntax OFF
Usage @CHECK ( OFF )
Parameters None
Return Value BOOLEAN
Errors This keyword does not set the error flag.
Example
@BOOLEAN state = CHECKSTATE()
@IF (state = ON) THEN
    @CHECK(OFF)
@COMMENT("Runtime error checking is suppressed")

Back to Top


OK

Category Reserved Words
Description Equivalent to boolean TRUE. See also TRUE and ON.
Support Wozterm and Wozix
Syntax OK
Usage @SETREPLY(OK, string expression)
Parameters None
Return Value BOOLEAN
Errors This keyword does not set the error flag.
Example
No example script segment available

Back to Top


ON

Category Reserved Words
Description Equivalent to boolean TRUE. See also TRUE and OK.
Support Wozterm and Wozix
Syntax ON
Usage @CHECK(ON)
Parameters None
Return Value BOOLEAN
Errors This keyword does not set the error flag.
Example
No example script segment available

Back to Top


@OPENREAD

Category File / Disk Handling Functions
Description Used to open a file for reading for use with @READ. See also @READ.
Support Wozterm and Wozix
Syntax @OPENREAD ( str exp )
Usage @OPENREAD(file_name)
Parameters file_name - The name of the file to be opened. May be free text or a variable. If set to an empty string, any file previously opened with @OPENREAD will be closed.
Return Value None
Errors The error flag is set if the file cannot be opened.
Example
@OPENREAD("\program files\wozterm\wozterm.ini")
@STRING test
@CHECK(OFF)
@READ(test)
@IFERROR then GOTO finished
@COMMENT(test)
@LABEL Finished
@OPENREAD("")

Back to Top


OR

Category Program Handling Functions
Description Boolean OR operator, returns TRUE if either or both of the expressions are TRUE. See also AND, NOT and XOR.
Support Wozterm and Wozix
Syntax bln exp OR bln exp
Usage exp1 OR exp2
Parameters exp1, exp2 - Literal, variable or expression which evaluates to a boolean value (TRUE or FALSE).
Return Value BOOLEAN - TRUE if either (or both) of the expressions evaluate to be TRUE, otherwise FALSE.
Errors This keyword does not set the error flag.
Example
@INTEGER num = 0
@STRING key = ""
@INKEY(key,"Press a key")
@SET num = ORD(key)
@DISPLAY("The key pressed ",num)
@IF num < 20 OR num > 80 THEN
    @COMMENT(" is less than 20 or greater than 80.")
@ELSE
    @COMMENT(" is between 20 and 80 inclusive.")

Back to Top


ORD

Category Data Manipulation Functions
Description Returns the ASCII integer value of the first character of a string. See also @CHR.
Support Wozterm and Wozix
Syntax ORD ( str exp )
Usage ORD(string)
Parameters string - Single character or string to be evaluated.
Return Value INTEGER - ASCII value of the first character, ie. 0 to 255
Errors This keyword does not set the error flag.
Example
@comment(ORD("abc")) ! 97 output to screen

Back to Top


@ORDERED

Category Communication Functions
Description Determines if an AXE ORDERED response will cause a logoff.
Support Wozterm and Wozix
Syntax @ORDERED ( exp )
Usage @ORDERED( ON / OFF / ALL )
Parameters ON - Default. Logs off if ORDERED appears on a line by itself in the response.
ALL - logs off if ORDERED appears anywhere in the response.
OFF - ignores any ORDERED response.
Return Value None
Errors This keyword does not set the error flag.
Example
@ORDERED(ALL)
RXBLI:MO=RXETS-40-1-7;
@ORDERED(ON)

Back to Top


OVMVERSION

Category Program Handling Functions
Description Returns the version number of OVM (script compiler) the application is using.
Support Wozterm and Wozix
Syntax OVMVERSION ( )
Usage OVMVERSION()
Parameters None
Return Value INTEGER - OVM script Version number
Errors This keyword does not set the error flag.
Example
@comment(OVMVERSION())

Back to Top


@PARAMISS

Category Communication Functions
Description Determines the handling of the System 12 'PARAMETER MISSING' response.
Support Wozterm and Wozix
Syntax @PARAMISS ( bln exp )
Usage @PARAMISS(ON/OFF)
Parameters ON - Default. Treats "PARAMETER MISSING" as an error response.
OFF - Treats "PARAMETER MISSING" as an acceptable response.
Return Value None
Errors This keyword does not set the error flag.
Example
@PARAMISS(OFF)
DISPLAY-SUBSCR?
K'0884417801.
@PARAMISS(ON)

Back to Top


PATTERNCREATE

Category Data Manipulation Functions
Description Defines search patterns for STRARRAYPMATCH and PATTERNMATCH. Uses the value set by PATTERNLEVEL to determine if pattern is case sensitive.
See also STRARRAYPMATCH, PATTERNMATCH, PATTERNDESTROY and PATTERNDESTROYALL.
Support Wozterm and Wozix
Syntax PATTERNCREATE ( str exp [, matching exp...] )
Usage PATTERNCREATE(1st pattern string [, 2nd pattern string , [...]])
Parameters No parameter description available
Return Value INTEGER - Pattern handle
Errors This keyword does not set the error flag.
Example
See STRARRAYPMATCH

Back to Top


@PATTERNDESTROY

Category Data Manipulation Functions
Description Destroys a previously defined pattern. See also PATTERNCREATE, PATTERNDESTROYALL, PATTERNLEVEL, PATTERNMATCH and STRARRAYPMATCH
Support Wozterm and Wozix
Syntax @PATTERNDESTROY ( int exp )
Usage @PATTERNDESTROY(pattern handle)
Parameters No parameter description available
Return Value None
Errors This keyword does not set the error flag.
Example
No example script segment available

Back to Top


@PATTERNDESTROYALL

Category Data Manipulation Functions
Description Destroys all previously defined patterns. See also PATTERNCREATE, PATTERNDESTROY, PATTERNLEVEL, PATTERNMATCH and STRARRAYPMATCH
Support Wozterm and Wozix
Syntax @PATTERNDESTROYALL
Usage @PATTERNDESTROYALL
Parameters None
Return Value None
Errors This keyword does not set the error flag.
Example
No example script segment available

Back to Top


@PATTERNLEVEL

Category Data Manipulation Functions
Description Used to set handling of wildcards and case sensitivity. See also FILESCANCH, FILESCANLN, PATTERNCREATE, POS, SETREPLY, STREAMLBSCAN, STREAMWAITFOR, STRPOS, TEXTEVSET, WAITFOR, PATTERNDESTROY, PATTERNDESTROYALL, PATTERNMATCH and STRARRAYPMATCH.
Support Wozterm and Wozix
Syntax @PATTERNLEVEL ( int exp [, bln exp] )
Usage @PATTERNLEVEL(wildcard_level [, case_sensitivity] )
Parameters wildcard_level - 0 for no wildcard search, 1 allows '*' and '?' to be used as wildcards, where '*' is any number of characters and '?' is any single character.
case_sensitivity (optional) - TRUE for the search to be case sensitive, FALSE to ignore case.
Return Value None
Errors This keyword does not set the error flag.
Example
@clrscr
@string sample1 = 'abc!decfg'
@string sample2 = 'abc,dec!f'
@string ptn1='c!'
@string ptn2='c'
@integer sincecreate = 0
@integer sincematch = 0
@integer match1
@integer match2
@integer handle = PATTERNCREATE(ptn1,ptn2)
@PATTERNLEVEL(0,true)

@comment('pattern 1 = ', ptn1)
@comment('pattern 2 = ', ptn2)
@set match1 = PATTERNMATCH(handle, sample1, sincecreate, sincematch)
@comment('in ',sample1,' match found at ',match1)
@comment('bytes since create = ',sincecreate,'. bytes since match = ',sincematch)
@set match2 = PATTERNMATCH(handle, sample2, sincecreate, sincematch)
@comment('in ',sample2,' match found at ',match1)
@comment('bytes since create = ',sincecreate,'. bytes since match = ',sincematch)

Back to Top


PATTERNMATCH

Category Data Manipulation Functions
Description Looks for matching patterns in data. This function works the same as STRARRAYPMATCH except it works on strings rather than string arrays. See also PATTERNCREATE, PATTERNDESTROY, PATTERNDESTROYALL and PATTERNLEVEL.
Support Wozterm and Wozix
Syntax PATTERNMATCH ( int exp, str exp [, int var [, int var]] )
Usage PATTERNMATCH(handle, data [, bytes_since_create [, bytes_since_match]])
Parameters handle - PATTERNCREATE Handle identifier.
data - Data sample to search for a match.
bytes_since_create (optional) - Number of bytes since the pattern was created.
bytes_since_match (optional) - Number of bytes since the pattern was matched.
Return Value INTEGER
0 - no match
1... - number of matching pattern
Errors This keyword does not set the error flag.
Example
See @PATTERNLEVEL

Back to Top


@PAUSE

Category Program Handling Functions
Description Pauses script execution. Script remains in memory.
Support Wozterm and Wozix
Syntax @PAUSE
Usage @PAUSE
Parameters None
Return Value None
Errors This keyword does not set the error flag.
Example
No example script segment available

Back to Top


@PORTNO

Category Deprecated Functions
Description Deprecated DOS Ozterm keyword.
Support This DOS Ozterm keyword has been deprecated - it is NOT supported.
Syntax N/A
Usage N/A
Parameters N/A
Return Value N/A
Errors This command will result in a compile error if used.
Example
N/A

Back to Top


POS

Category Data Manipulation Functions
Description Returns the start position of a substring within a string. The optional parameter 'occurrence' may be set to find a particular occurrence of the substring. If 'occurrence' is not specified then POS will return the first occurrence of substring. Occurrence parameter may also be set to LAST (or any number less than 1) which returns the last occurrence of sub_string in the string to be searched, even if sub_string only occurs once. If 'occurrence' is greater than the number of times sub_string occurs, then 0 is returned. Uses the value set by PATTERNLEVEL to determine if search is case sensitive. POS is an alias for STRPOS.
Support Wozterm and Wozix
Syntax POS ( str exp, str exp [, int exp] )
Usage POS(sub_string, string [, occurrence])
Parameters sub_string - Characters to be searched for.
string - Text being searched looking for sub_string
occurrence (optional) - Used to request a particular occurrence of sub_string. May be an Integer, eg. 2 means the second occurrence, or LAST to find the last occurrence.
Return Value INTEGER - Start position of the requested occurrence of sub_string in the string.
Errors This keyword does not set the error flag.
Example
@CLRSCR
@string textToSearch = '123456789012345678901234567890'
@integer position

@position = POS('3',textToSearch) 			!position = 3
@comment('First "3" is at position ',position,' in ',textToSearch)

@position = POS('345',textToSearch) 			!position = 3
@comment('First "345" is at position ',position,' in ',textToSearch)

@position = POS('3',textToSearch,1) 			!position = 3
@comment('First "3" is at position ',position,' in ',textToSearch)

@position = POS('3',textToSearch,2) 			!position = 13
@comment('Second "3" is at position ',position,' in ',textToSearch)

@position = POS('3',textToSearch,3) 			!position = 23
@comment('Third "3" is at position ',position,' in ',textToSearch)

@position = POS('3',textToSearch,LAST)			!position = 23
@comment('Last "3" is at position ',position,' in ',textToSearch)

@position = POS('3',textToSearch,-50) 			!position = 23
@comment('Last "3" is at position ',position,' in ',textToSearch)

@position = POS('a',textToSearch)
@comment('"a" is at position ',position,' in ',textToSearch)		!position = 0

@position = POS('3',textToSearch,6)
@comment('Sixth "3" is at position ',position,' in ',textToSearch)	!position = 0

@position = POS('',textToSearch)
@comment('Empty string is at position ',position,' in ',textToSearch)	!position = 0

@position = POS('3','')
@comment('"3" is at position ',position,' in empty string')	!position = 0

@position = POS('abcdef','abc')
@comment('"abcdef" is at position ',position,' in "abc"')	!position = 0

Back to Top


@PRINTER

Category File / Disk Handling Functions
Description Turns printer logging on or off. Not currently supported.
Support Wozterm and Wozix
Syntax @PRINTER ( bln exp )
Usage @PRINTER( ON / OFF )
Parameters No parameter description available
Return Value None
Errors This keyword does not set the error flag.
Example
No example script segment available

Back to Top


@PROCEDURE

Category Program Handling Functions
Description Defines a user defined procedure. User defined procedures can be used like a built in command. Similar to @FUNCTION except there is no return value. Parameters can be passed by reference (using BYREF) or by value.
Note: Procedures must be defined before they can be used. That is, they must appear in the script file before where they are called.
Note: Procedure body must be enclosed between @BEGIN and @END.
For more information see Procedures & Functions overview.
Note: CHECK status is local to a procedure or function. It is set to ON (default) upon entering a procedure or function and restored to previous state upon exit.
Support Wozterm and Wozix
Syntax @PROCEDURE proc_name ( [ parameter ...] )
@BEGIN
...
@END
Usage @PROCEDURE proc_name ( [ param ... ] ) code
Parameters proc_name - The name of the procedure, used when invoking it.
param (optional) - 0 or more parameters for the procedure to use, made up of the keywords INTEGER, BOOLEAN, STRING followed by parameter name separated by ','. To define parameters of different types separate the parameters by ';'.
code - Instruction (or instructions) that does something, eg SET, COMMENT, DISPLAY, CONNECT etc.
Return Value None
Errors This keyword does not set the error flag.
Example
@PROCEDURE HelloWorld()
@BEGIN
    @COMMENT("Hello world")
@END

@HelloWorld

! ------------------ OR ------------------

@PROCEDURE Echo(STRING s1, s2)
@BEGIN
    @COMMENT(s1,s2)
@end

@Echo("Hello"," world")

! ------------------ OR ------------------

@PROCEDURE ConnectTo(BYREF BOOLEAN result; STRING new_mode, host, user, passwd; INTEGER attempts)
@BEGIN
    @MODE(new_mode)

    @CHECK(OFF)
    @WHILE (attempts > 0) DO
    @BEGIN
        @IF host = "" THEN
            @CONNECT
        @ELSE IF user = "" OR passwd = "" THEN
            @CONNECT(host)
        @ELSE
            @CONNECT(host,"",user,passwd)

        @IFERROR then
        @BEGIN
            @INTEGER errorval
            @STRING  errstr
            @CALL GETERRORFLAG(errorval, errstr)
            @COMMENT("Connect ERROR: num = " + str(errorval) + "  Cause = " + errstr)
        @END
        @ELSE
        @BEGIN
            @SET result = TRUE
            @ENDLOOP
        @END

        @DEC(attempts)
        @IF attempts > 0 THEN
        @BEGIN
            @COMMENT("Next connection attempt in 5 seconds...")
            @DELAYSEC(5)
        @END
    @END
    @CHECK(ON)
@END

@BOOLEAN connected = FALSE
@ConnectTo(connected,"UNIX","","","",3)
@IF connected THEN
    @COMMENT("Connection made successfully.")
@ELSE
    @COMMENT("Unable to make connection.")

Back to Top


PROGRAMDIR

Description Returns the ProgramDirectory path of the application. This is where Wozterm is normally installed, ie C:\Program Files. See also @USERDIR, @SAVEDIR, @SESSION, @MACHINEDIR, @GETDIR, @CHDIR, @MKDIR, @RMDIR and @SESSIONDIR. In OZI (Ozterm6 Interpreter) mode this keyword may be used as either a command or a function.
When used as a command (@PROGRAMDIR - OZI mode only):
The path of the currently executing Wozterm program file is returned within the variable supplied as the parameter.
When used as a function (PROGRAMDIR()):
The path of the currently executing Wozterm program file is the return value.
Note: as the variables used as parameters are passed by reference any existing values they store will be overwritten.
Support Wozterm and Wozix
Syntax PROGRAMDIR ( )
Usage @PROGRAMDIR(path) or (OZI mode only) PROGRAMDIR[()]
Parameters None
Return Value STRING - ProgramDirectory path
Errors This keyword does not set the error flag.
Example
@comment(PROGRAMDIR())

Back to Top


@PROMPT

Category Screen / Input / Output Functions
Description Prompts user if script should continue execution.
Support Wozterm
Syntax @PROMPT
Usage @PROMPT
Parameters None
Return Value None
Errors This keyword does not set the error flag.
Example
No example script segment available

Back to Top


@QUIT

Category Program Handling Functions
Description Halts script execution and closes application.
Support Wozterm and Wozix
Syntax @QUIT ( [int exp] )
Usage @QUIT[(status)]
Parameters status - Optional parameter which sets the exit code
Return Value None
Errors This keyword does not set the error flag.
Example
@iferror then goto quit100
.....

@label quit100
  @QUIT(100)

Back to Top


RANDOM

Category Data Manipulation Functions
Description Generates a pseudo random number between 1 and the maximum value specified.
Support Wozterm and Wozix
Syntax RANDOM ( int exp )
Usage RANDOM ( max_value )
Parameters max_value - Maximum integer limit for the random number.
Return Value INTEGER - A random number greater than 0 and less than or equal to 'max_value'
Errors This keyword does not set the error flag.
Example
@COMMENT(RANDOM(10))	! outputs pseudo random number between 1 & 10
@COMMENT(RANDOM(100))	! outputs pseudo random number between 1 & 100
@COMMENT(RANDOM(1))	! always outputs 1
@COMMENT(RANDOM(0))	! always outputs 1

Back to Top


@READ

Category File / Disk Handling Functions
Description Reads a line of text from the last file opened with @OPENREAD.
Note: Only works with a file opened by @OPENREAD.
Support Wozterm and Wozix
Syntax @READ ( str var )
Usage @READ(data)
Parameters data - STRING variable used to store the line of text read from the file.
Return Value None
Errors Error flag set if no file opened with OPENREAD, or the end-of-file has been reached.
Example
@OPENREAD("\program files\wozterm\wozterm.ini")
@STRING test
@READ(test)
@COMMENT(test)
@OPENREAD("")

Back to Top


REGRESS

Category Date & Time Functions
Description Regress a date & time by a single interval. Works like @ADVANCE except it regresses the date by single interval only.
Support Wozterm and Wozix
Syntax REGRESS ( str exp, str exp )
Usage REGRESS( date_time, interval )
Parameters date_time - Representation of date in valid format (eg. YYYYMMDDhhmm).
interval - Can take the values 0 - 99 with W, D, H, or M. (ie 0 - 99 Weeks, Days, Hours or Minutes)
Return Value STRING - Regressed date and time
Errors This keyword does not set the error flag.
Example
See @ADVANCE example.

Back to Top


@RENAME

Category File / Disk Handling Functions
Description Renames a file by calling the operating systems rename function. Alias for @FILERENAME.
Support Wozterm and Wozix
Syntax @RENAME ( str exp, str exp )
Usage @RENAME(old_filename, new_filename)
Parameters old_filename - Name of the file that is to be renamed.
new_filename - The new name for the file.
Return Value None
Errors Error flag is set if operating system will not permit the rename, eg. old filename does not exist or new filename does.
Example
@STRING logName = GETLOG()                  ! Obtain name of log file
@CLOSE(logName    )                         ! Stop logging to the file
@RENAME(logName, CONCAT(logName,".bac"))    ! Rename, to keep as backup
@LOG(logName)                               ! Start logging again, new file

Back to Top


@REPEAT

Category Program Handling Functions
Description Defines a loop that continues until a boolean condition is met. Must be used in conjunction with @UNTIL. Unlike @FOR or @WHILE loops the exit condition is tested after the command block has been executed, thus the contents of a @REPEAT loop will always be executed at least once. When more than a single command is required per loop a @BEGIN ... @END block can be used.
The @NEXTLOOP command can be used to go on to the next iteration of the loop.
The @ENDLOOP command can be used to exit (terminate) a loop before the exit guard condition is met.
Support Wozterm and Wozix
Syntax @REPEAT
[ @BEGIN ]
...
[ @END ]
@UNTIL bln exp
Usage @REPEAT code UNTIL condition
Parameters code - Instruction (or instructions with @BEGIN ... @END) that does something, eg SET, GOTO, GOSUB, etc.
condition - Statement which should evaluate to TRUE if the loop is to be exited. Loop will continue to be performed if it evaluates to FALSE.
Return Value None
Errors This keyword does not set the error flag.
Example
@INTEGER count = 0
@REPEAT
@BEGIN
    @COMMENT("count = ",count)
    @INC(count)
@END
@UNTIL count >= 10

! ------------------ OR ------------------

@STRING min_ahead = GETDATETIME(60*1000)
@REPEAT
    @SLEEP(1)
@UNTIL min_ahead < GETDATETIME()
@COMMENT("One minute has passed.")

Back to Top


REPLY

Category Communication Functions
Description Returns a line of text from the terminal window relative to the last host command or @MARK. See also @MARK, @SCAN and REPLYLEN.
Support Wozterm and Wozix
Syntax REPLY ( int exp )
Usage REPLY(line)
Parameters line - An integer used to identify which line of text from the last MARKed position to read from the terminal screen.
Return Value STRING - Line of text
Errors This keyword does not set the error flag.
Example
@SET line = SCAN('B-NUMBER     ',bnpos)
@set data = REPLY(line)
@SET miscellpos = POS('MISCELL ',data)
@SET colfn      = POS(' F/N ',data) + 1
@SET colrte     = POS('ROUTE',data)
@set tflag = 0

Back to Top


REPLYLEN

Category Communication Functions
Description Returns the number of lines received since the last host command or @MARK. See also @MARK, @SCAN and REPLY.
Support Wozterm and Wozix
Syntax REPLYLEN ( )
Usage REPLYLEN()
Parameters None
Return Value INTEGER - Number of lines received.
Errors This keyword does not set the error flag.
Example
@label LPBN
@IF line = REPLYLEN() THEN GOTO CALCBN
@INC(line)
@set resp = REPLY(line)
@if POS('B-NUMBER', resp) > 0 then GOTO LPBN      @@ Ignore headers

Back to Top


@REPORT

Category Communication Functions
Description Determines how the System 12 'REPORT FOLLOWS' response is handled. For System 12 modes to allow multiple commands to be entered when 'REPORT FOLLOWS' is received instead of waiting for 'LAST REPORT.'
Support Wozterm and Wozix
Syntax @REPORT ( bln exp )
Usage @REPORT( ON / OFF )
Parameters ON - Allows next command to be entered when 'REPORT FOLLOWS' is received.
OFF - Default, only enters the next command after 'LAST REPORT' is received.
Return Value None
Errors This keyword does not set the error flag.
Example
@check(off)
@REPORT(ON)
activate-ceovld-observ:lceid=h'0000,strdate={date},strtime={ctime},outperd=00&03,outset=104;
@REPORT(off)
@IFERROR then GOTO err_fin
@call WAITFOR(15,"REPORT FOLLOWS")

Back to Top


RESOLVEIP

Category Communication Functions
Description Resolves the host name of a given IP
Use @HOSTCMDTIMEOUT.
Support Wozterm and Wozix
Syntax RESOLVEIP ( str exp [, 1 dimensional str array] )
Usage resolveip(ip, [host name array])
Parameters No parameter description available
Return Value STRING - Host name
Errors This keyword does not set the error flag.
Example
No example script segment available

Back to Top


@RESTART

Category Program Handling Functions
Description Restarts the current script file from the first line.
Note: default values are not restored.
Support Wozterm and Wozix
Syntax @RESTART
Usage @RESTART
Parameters None
Return Value None
Errors This keyword does not set the error flag.
Example
@comment('infinite loop')
@RESTART

Back to Top


@RETURN

Category Program Handling Functions
Description Forces an immediate return from a @SUBROUTINE, @PROCEDURE, @FUNCTION or @TRAP. See also @SUBROUTINE, @PROCEDURE, @FUNCTION and @TRAP.
Support Wozterm and Wozix
Syntax @RETURN
Usage @RETURN
Parameters None
Return Value None
Errors This keyword does not set the error flag.
Example
@INTEGER a_number = RANDOM(100)

@SUBROUTINE SampleSubroutine
@BEGIN
    @COMMENT("Entered subroutine")
    @WHILE TRUE DO                                  ! endless loop
    @BEGIN
        @IF a_number > 50 THEN
            @COMMENT(a_number," is greater than 50")
        @ELSE
            @RETURN
        @SET a_number = RANDOM(100)
    @END
@END

@GOSUB SampleSubroutine
@COMMENT("Returned from subroutine")

! ------------------ OR ------------------

@PROCEDURE SampleProcedure(BYREF INTEGER num)
@BEGIN
    @COMMENT("Entered procedure")
    @WHILE TRUE DO                                  ! endless loop
    @BEGIN
        @IF num < 50 THEN
            @COMMENT(num," is less than 50")
        @ELSE
            @RETURN
        @SET num = RANDOM(100)
    @END
@END

@SampleProcedure(a_number)
@COMMENT("Returned from procedure")

! ------------------ OR ------------------

@FUNCTION BOOLEAN SampleFunction(BYREF INTEGER num)
@BEGIN
    @COMMENT("Entered function")
    @WHILE TRUE DO                                  ! endless loop
    @BEGIN
        @IF num > 50 THEN
            @COMMENT(num," is greater than 50")
        @ELSE
            @RETURN
        @SET num = RANDOM(100)
    @END
@END

@CALL SampleFunction(a_number)
@COMMENT("Returned from function")

! ------------------ OR ------------------

@TRAP SampleTrap
@BEGIN
    @COMMENT("Entered trap")
    @SETERRORFLAG(OFF,0)
    @WHILE TRUE DO                                  ! endless loop
    @BEGIN
        @IF a_number < 50 THEN
            @COMMENT(a_number," is less than 50")
        @ELSE
            @RETURN
        @SET a_number = RANDOM(100)
    @END
@END

@CHECK(OFF,SampleTrap)
@INTEGER num_0 = 0
@INTEGER cause_err = 1 / num_0
@COMMENT("Returned from trap")

Back to Top


@RMDIR

Category File / Disk Handling Functions
Description Removes a directory. See also @GETDIR, @USERDIR, @SAVEDIR, @SESSION, @MKDIR, @MACHINEDIR, @CHDIR, @SESSIONDIR and @PROGRAMDIR.
Support Wozterm and Wozix
Syntax @RMDIR ( str exp )
Usage @RMDIR(directory)
Parameters directory - Directory to be removed.
Return Value None
Errors Error flag is set if unable to remove the directory, ie. directory is not empty, does not exist or insufficient rights.
Example
@MKDIR('test_dir')
@check(off)
@RMDIR('test_dir')
@IFERROR then comment('error')
@else comment('Removed OK')
@RMDIR('test_dir')
@IFERROR then comment('error')
@else comment('Removed OK')

Back to Top


@RUN

Category Program Handling Functions
Description Current script is unloaded and control passed to the specified script. Similar to @INCLUDE, except the script does not return to the original file when the called file has finished.
Support Wozterm and Wozix
Syntax @RUN ( str exp [, matching exp...] )
Usage @RUN(filename [, label [, argument [, ...]]])
Parameters filename - Name of the script file to run.
label (optional) - Label name in the script file called to start running from.
argument (optional) - Arguments used by the script file called.
Return Value None
Errors This keyword does not set the error flag.
Example
@comment("in r1")
@RUN("scripts\s2.cmd")

! Previous script is closed and s2.cmd is now run, ie. does not return to r1.cmd when s2.cmd completes.

Back to Top


@SAVEDIR

Category File / Disk Handling Functions
Description Returns the original session working directory when application was started. See also @USERDIR, @SESSION, @GETDIR, @SESSIONDIR, @MKDIR, @CHDIR, @MACHINEDIR and @PROGRAMDIR. In OZI (Ozterm6 Interpreter) mode this keyword may be used as either a command or a function.
When used as a command (@SAVEDIR):
The path of the original session directory is returned within the variable supplied as the parameter.
When used as a function (SAVEDIR() - OZI mode only):
The path of the original session directory is the return value.
Note: as the variables used as parameters are passed by reference any existing values they store will be overwritten.
Support Wozterm and Wozix
Syntax @SAVEDIR ( str var )
Usage @SAVEDIR(directory) or (OZI mode only) @set directory = SAVEDIR[()]
Parameters directory - STRING variable used to store the directory path.
Return Value None
Errors This keyword does not set the error flag.
Example
@string wdir, _workdrv, _workpath
@SAVEDIR(wdir)
@set _workdrv = copy(wdir,1,2)
@set _workpath = copy(wdir,3,length(wdir)-2)

Back to Top


SCAN

Category Communication Functions
Description Searches the terminal window for a string from the last host command or @MARK. See also @MARK, REPLY and REPLYLEN.
Support Wozterm and Wozix
Syntax SCAN ( str exp [, int var] )
Usage SCAN(search_string [, column])
Parameters search_string - String to scan for in the terminal window.
column (optional) - INTEGER variable used to store the column number where the search string starts.
Return Value INTEGER - Line number, 0 if the search string is not found.
Errors This keyword does not set the error flag.
Example
@SET line = SCAN(" CSW ",csw_col) + 1
@if line > 0 then SET sw = trim(copy(reply(line),csw_col,6))

Back to Top


@SCREENTIMEOUT

Category Deprecated Functions
Description Deprecated DOS Ozterm keyword.
Support This DOS Ozterm keyword has been deprecated - it is NOT supported.
Syntax N/A
Usage N/A
Parameters N/A
Return Value N/A
Errors This command will result in a compile error if used.
Example
N/A

Back to Top


@SELFILE

Category File / Disk Handling Functions
Description Allows the user to select a file. After user selects file, 'filename' string passed by reference will contain the file name. If directory without mask used Wozterm assumes mask of "*.*". If no directory specified then select dialogue is set initially to session directory.
Support Wozterm
Syntax @SELFILE ( str var [, str exp] )
Usage @SELFILE(filename [, prompt])
Parameters filename - STRING variable which may be preset to provide and directory path and mask. Selected file is stored in this variable.
prompt (optional) - Text to be displayed as part of the file selection dialogue box.
Return Value None
Errors This keyword does not set the error flag.
Example
! example with user prompt, directory and mask specified
@string file = "c:\temp\*.txt"
@SELFILE(file,'Select a file')
@comment(file)                  ! file selected displayed

! example with  directory and mask specified
@string file = "c:\temp\*.txt"
@SELFILE(file)
@comment(file)                  ! file selected displayed

! example with user prompt, directory and no mask specified
@string file = "c:\temp\"       ! Wozterm assumes "*.*" mask
@SELFILE(file,'Select a file')
@comment(file)                  ! file selected displayed

! example with user prompt, mask specified
@string file = "*.txt"
@SELFILE(file,'Select a file')  ! dialog starts in session directory
@comment(file)                  ! file selected displayed

Back to Top


@SELPRINT

Category File / Disk Handling Functions
Description (NOT YET SUPPORTED) Selects the printer for printer logging.
Support Wozterm and Wozix
Syntax @SELPRINT ( int exp )
Usage @PRINTER(printer number)
Parameters No parameter description available
Return Value None
Errors This keyword does not set the error flag.
Example
No example script segment available

Back to Top


@SEND

Category Communication Functions
Description Sends data to the host / network element. See also SENDWAITFOR and WAITFOR. See @BELL for using sounds on a workstation.
Support Wozterm and Wozix
Syntax @SEND ( int/str exp, [, int/str exp...] )
Usage @SEND(data [, data ...])
Parameters data - May be one or more strings, integers or ASCII codes, eg #24#10. If a #7 character is sent, it will generally be echoed by the connected host to the Wozterm terminal, which will respond with a short beep.
Return Value None
Errors This keyword does not set the error flag.
Example
@SEND('ALSTP;',#13)  ! sends a host command with a carriage return to the connected host.

Back to Top


SENDWAITFOR

Category Communication Functions
Description Sends data to a host and wait for a response. Uses the value set by @PATTERNLEVEL to determine case sensitivity. This command is used instead of separate @SEND(...) @set result = WAITFOR(....) statements to cater for responses that may happen immediately after the SEND string is sent. This will ensure all responses will be trapped. In OZI (Ozterm6 Interpreter) mode this keyword may be used as either a command or a function. When used as a command (@SENDWAITFOR - OZI mode only)): The return code (see below) is returned within the variable supplied as the first parameter, the SEND string is the second parameter, the timeout value is the third parameter, the first response to wait for is the fourth parameter, and the second response to wait for is an optional fifth parameter. When used as a function (SENDWAITFOR(): The return code (see below) is the function's return value, the SEND string is the first parameter, the timeout value is the second parameter, the first response to wait for is the third parameter, and the second response to wait for is an optional fourth parameter.
Support Wozterm and Wozix
Syntax SENDWAITFOR ( int/str exp, int exp, int/str exp [, int/str exp] )
Usage SENDWAITFOR(data, timeout, 1st_response [, 2nd_response]) or
(OZI mode only) @SENDWAITFOR(return, data, timeout, 1st_response [, 2nd_response])
Parameters data - May be one or more strings or ASCII codes which is sent to the host.
timeout - Time out value in seconds to wait for the expected response(s). 0 for no time out. If time-out occurs, result returned is 0.
1st_response - First response string to wait for. If this response is received, result returned is 1.
2nd_response (optional) - Second response string to wait for. If this response is received, result returned is 2.
Return Value INTEGER
0 - Timed out, ie none of the specified responses received.
1 - First response has been received.
2 - Second response received.
Errors Error flag set if time out occurs.
Example
@integer result
@result = SENDWAITFOR(CONCAT("cd /; ls -l",#13),5,"root","sbin")
@IFERROR THEN COMMENT("BAD")
@ELSE COMMENT("GOOD")
@COMMENT("@SENDWAITFOR result = ",result)

Back to Top


SESSION

Description Returns the current session number.eg if you are working in Session 3 SESSION() will return "003". See also @USERDIR, @SAVEDIR, @SESSIONDIR, @MACHINEDIR and @PROGRAMDIR.
Support Wozterm and Wozix
Syntax SESSION ( )
Usage SESSION()
Parameters None
Return Value STRING - Session number as a 3 digit right justified zero filled string
Errors This keyword does not set the error flag.
Example
@comment(SESSIONDIR(),"\",SESSION())

Back to Top


SESSIONDIR

Description Returns the UserNonRoamingDirectory path of the application. This is where the session logs and working files are stored. See also @USERDIR, @GETDIR, @SAVEDIR, @SESSION, @MKDIR, @CHDIR, @MACHINEDIR and @PROGRAMDIR. In OZI (Ozterm6 Interpreter) mode this keyword may be used as either a command or a function.
When used as a command (@SESSIONDIR - OZI mode only)):
The current session's working directory is returned within the variable supplied as the parameter.
When used as a function (SESSIONDIR():
The current session's working directory is the function's return value.
Support Wozterm and Wozix
Syntax SESSIONDIR ( )
Usage SESSIONDIR() or
(OZI mode only) @SESSIONDIR(path) or SESSIONDIR
Parameters None
Return Value STRING - UserNonRoamingDirectory path
Errors This keyword does not set the error flag.
Example
@comment(SESSIONDIR())

Back to Top


@SET

Category Program Handling Functions
Description Used to set the value of a variable. To define variables use @BOOLEAN, @INTEGER or @STRING.
Note: The use of @SET is optional.
Support Wozterm and Wozix
Syntax @SET var_name = ( int exp / bln exp / str exp )
Usage @SET var_name = value
Parameters var_name - The name of a defined variable to assign the new value to.
value - Literal, variable or expression which is to be assigned to the variable. Must evaluate to the same type as that of the variable.
Return Value None
Errors This keyword does not set the error flag.
Example
@INTEGER a_int

@SET a_int = 10
@COMMENT("a_int = ",a_int)
@a_int = 5
@COMMENT("a_int = ",a_int)

@BOOLEAN a_bool

@SET a_bool = true
@IF a_bool THEN
@COMMENT("a_bool is TRUE")
@a_bool = false
@IF NOT a_bool THEN
@COMMENT("a_bool is FALSE")

@STRING a_str

@SET a_str = "Hello world"
@COMMENT(a_str)
@a_str = "Hello there"
@COMMENT(a_str)

Back to Top


@SETDEST

Category Communication Functions
Description Sets the destination name associated with the current session. See also @GETDEST.
Support Wozterm and Wozix
Syntax @SETDEST ( str exp )
Usage @SETDEST(name)
Parameters name - Destination name associated with the current session.
Return Value None
Errors This keyword does not set the error flag.
Example
@SETDEST("SESSION - 1")
@string var = GETDEST()
@comment(var)

Back to Top


@SETERRORFLAG

Category Program Handling Functions
Description Set or reset the error flag and error number. See also @GETERRORFLAG.
Support Wozterm and Wozix
Syntax @SETERRORFLAG ( bln exp [, int exp] )
Usage @SETERRORFLAG( ON / OFF [, error_number])
Parameters ON - Sets the Error Flag ON.
OFF - Sets the Error Flag OFF.
error_number (optional) - Sets the Error Number for retrieval by @GETERRORFLAG.
Return Value None
Errors This keyword does not set the error flag.
Example
@trap filescantrap
@begin
    @integer errnum = 0
    @if GETERRORFLAG(errnum) and errnum = 654 then
    @begin
        @SETERRORFLAG(off,0)
        @endofsearch = true
    @end
@end

Back to Top


@SETPASSWORD

Category Communication Functions
Description Sets the default password for the specified mode. See also @GETPASSWORD.
Support Wozterm and Wozix
Syntax @SETPASSWORD ( str exp, str exp )
Usage @SETPASSWORD(mode_name, password)
Parameters mode_name - Mode name to identify which system password to set.
password - The password to be set for the specified mode. Set to empty string, ie. "", to clear the password.
Return Value None
Errors This keyword does not set the error flag.
Example
@mode("NEAS DMS")
@SETUSERNAME("DMS","LNCD|_user")
@SETPASSWORD("DMS","password")

Back to Top


@SETREPLY

Category Communication Functions
Description Used to set OK and FAIL responses for use with @WAITREPLY. See also @WAITREPLY.
Support Wozterm and Wozix
Syntax @SETREPLY ( bln exp, str exp )
Usage @SETREPLY(OK/FAIL, response)
Parameters OK - Indicates that the 'response' set is OK and to continue.
FAIL - Indicates that the 'response' set is an error and to set the error flag.
response - The response string to be set for the OK or FAIL indication. Set to empty string, ie. "", to clear the respective OK or FAIL strings.
Return Value None
Errors This keyword does not set the error flag.
Example
IMLCT:SPG=0;
MCDSC:IO={AT},SEP=YES;
END;
@SETREPLY(FAIL,'***')
@SETREPLY(OK,"LOGGED OFF")
EXIT;
@SETREPLY(OK,"SYSTEM RESTARTED")
@WAITREPLY
@SETREPLY(OK,"")
@SETREPLY(FAIL,"")

Back to Top


@SETUSERNAME

Category Communication Functions
Description Sets the default user name for the specified mode. See also @GETUSERNAME.
Support Wozterm and Wozix
Syntax @SETUSERNAME ( str exp, str exp )
Usage @SETUSERNAME(mode_name, username)
Parameters mode_name - Mode name to identify which system user name to set.
username - The user name to be set for the specified mode. Set to empty string, ie. "", to clear the user name.
Return Value None
Errors This keyword does not set the error flag.
Example
@mode("NEAS DMS")
@SETUSERNAME("DMS","LNCD|_user")
@SETPASSWORD("DMS","password")

Back to Top


SINGLE

Category Date & Time Functions
Description Used with @ADVANCE to limit the change in time to 1 interval. Only required when Advancing a date/time string that is in the past. See also @ADVANCE.
Support Wozterm and Wozix
Syntax ADVANCE ( str exp, str exp, SINGLE )
Usage ADVANCE ( date_time, interval, SINGLE )
Parameters None
Return Value None
Errors This keyword does not set the error flag.
Example
@STRING yesterday, time23hoursago

@SET yesterday = REGRESS(GETDATETIME(),"1D")
@SET time23hoursago = ADVANCE(yesterday,"1H",SINGLE)
@COMMENT("The time 23 hours ago was ", time23hoursago)

Back to Top


@SLEEP

Category Date & Time Functions
Description Pauses script execution for approximately the number of milliseconds specified. See also @DEL5MSEC, @DELAYSEC and @DELAY.
Support Wozterm and Wozix
Syntax @SLEEP ( int exp )
Usage @SLEEP(Number_of_milliseconds)
Parameters Number_of_milliseconds - INTEGER indicating the number of milliseconds to "sleep".
Return Value None
Errors This keyword does not set the error flag.
Example
@SLEEP(100)     ! Sleep for 100 milliseconds

Back to Top


SNMPRECVTRAP

NB: This keyword is still being beta tested and is not available with the released version of Wozterm
Category Currently Beta Testing
Description Send an SNMP trap
Support Wozterm and Wozix
Syntax SNMPRECVTRAP ( str exp, int exp, str var, int var, 2 dimensional str array )
Usage @SNMPRECVTRAP(transport type, port number, source host, operation, variables)
Parameters transport type - The type of transport to receive the trap over. This will typically be UDP or TCP
port number - The port number to receive the trap on
source host - Stores the name of the host that sent the trap
operation - Stores the type of operation that was indicated by the received trap. This will be 1 for successful traps
variables - This will populate a 3 x X array with the variables from the trap
Return Value INTEGER - Number of variables received by trap
Errors This keyword does not set the error flag.
Example
@comment("waiting for trap")
@string hostname = ""
@string transportType = "udp"
@integer operation = -1
@integer numvars
@integer portNum = 162
@string arr[3, 10]
@integer max = 10
@set numvars = SNMPRECVTRAP(transportType, portNum, hostname, operation, arr)
@comment()
@comment("Received from: ", hostname)
@comment("Operation:     ", operation)
@comment("Numvars:       ", numvars)
@comment()
@if (0 < numvars) then
@begin
	@if (numvars < 10) then
		@max = numvars

	@for integer j = 1 to max
	@begin
		@comment("oid : ", arr[1, j])
		@comment("type: ", arr[2, j])
		@comment("val : ", arr[3, j])
	@end
@end
@comment()

Back to Top


SNMPSENDTRAP

NB: This keyword is still being beta tested and is not available with the released version of Wozterm
Category Currently Beta Testing
Description Send an SNMP trap
Support Wozterm and Wozix
Syntax SNMPSENDTRAP ( str exp, str exp, int exp, str exp [, str exp [, matching exp...]] )
Usage @SNMPSENDTRAP(community, agent, uptime, trap_oid, [oid, type, value, ...])
Parameters community - The community string for the trap to send
agent - The agent to send the trap to. The agent string is in the form [:]
uptime - The uptime for the host
trap_oid - The OID for the trap being sent
oid - OID for the variable
type - Type for the variable
value - Value for the variable
Return Value INTEGER
Errors This keyword does not set the error flag.
Example
@string mystr = "test"
@string community = "public"
@string agent = "udp:localhost:162"
@integer uptime = 123
@string trap_oid = "enterprises.1088.11.11.1"
@string oid = "enterprises.1088.11.11.1.2"
@string type = 's'
@integer result = SNMPSENDTRAP(community, agent, uptime, trap_oid, oid, type, mystr)

Back to Top


SQLAQPOPSTRING

NB: To use SQL keywords Oracle's Instant Client must be installed on your workstation.
Download from http://www.oracle.com/technology/tech/oci/instantclient/instantclient.html (at time of writing)
Category Oracle Functions
Description Get contents of message dequeued from Oracle Advanced Queue.
As a message, previously dequeued using the SQLDQMESSAGE in Oracle Advanced Queue can be longer than OVM maximum string length this function accepts a string array as it's second parameter. The first element in the array will contain the first 255 characters in the message the second will contain the next 255 characters and so on. Following optional parameters give further information that could prove useful should the array not be large enough to accommodate message. In this case, characters that do not fit will be lost.
Support Wozterm and Wozix
Syntax SQLAQPOPSTRING ( int exp, 1 dimensional str array [, int var [, int var [, int var]]] )
Usage SQLAQPOPSTRING(connection_handle, output_array [, total_chars_popped [, number_OVMstrings_in_array] [, chars_in_last_string]] )
Parameters connection_handle - handle to database connection
output_array - destination array of OVMstrings (passed by reference) which will contain message
total_chars_popped (optional) - number of characters popped to destination array
number_OVMstrings_in_array (optional) - number of filled elements in destination array
chars_in_last_string (optional) - number of characters in last popped string
Return Value BOOLEAN - Indicating success or failure
Errors Error flag set if OCI not installed, database not initialised or if OCI error occurs
Example
! declare output string array and other parameters
@STRING message[16]
@INTEGER poppedChars=0, numStrs=0, lastChars=0

! assume handle already established - see SQLLOGIN

! dequeue (remove not browse) message with correlation ID = "Robot1".
! Wait up to 2 seconds for message to become available
@CALL SQLDQMESSAGE(handle, SCHEMA, QUEUE, DBOBJECT, false, "Robot1", 2)
! pop string to message array
@CALL SQLAQPOPSTRING(handle, message, poppedChars, numStrs, lastChars)

! display popped message
@IF numStrs > 0 THEN
@BEGIN
	@DISPLAY(message[1])
	@FOR INTEGER i = 2 TO numStrs
		@DISPLAY(" ", message[i])
	@COMMENT()
@END
@ELSE
@BEGIN
	@COMMENT("No message")
@END

Back to Top


SQLAQPUSHSTRARR

NB: To use SQL keywords Oracle's Instant Client must be installed on your workstation.
Download from http://www.oracle.com/technology/tech/oci/instantclient/instantclient.html (at time of writing)
Category Oracle Functions
Description Puts contents of string array into Oracle Advanced Queue message for subsequent enqueue. This function can be used to create a message from the entire contents of a string array.
Support Wozterm and Wozix
Syntax SQLAQPUSHSTRARR ( int exp, 1 dimensional str array )
Usage SQLAQPUSHSTRARR(connection_handle, string array)
Parameters connection_handle - handle to database connection
string array - string array which will create message
Return Value BOOLEAN - Indicating success or failure
Errors Error flag set if OCI not installed, database not initialised or if OCI error occurs
Example
! assume handle already established - see SQLLOGIN
! assume strarr (String Array) has already been initialised with data 
! for example see FILEREADARRAY @CALL SQLAQPUSHSTRARR(handle, strarr) ! Now enqueue "This is first part of message. This is second part of message." with correlation_ID of "Robot1" and ! priority, delay and timeout = 0 @CALL SQLEQMESSAGE(handle, SCHEMA, QUEUE, DBOBJECT, "Robot1", 0,0,0)

Back to Top


SQLAQPUSHSTRING

NB: To use SQL keywords Oracle's Instant Client must be installed on your workstation.
Download from http://www.oracle.com/technology/tech/oci/instantclient/instantclient.html (at time of writing)
Category Oracle Functions
Description Puts contents of string into Oracle Advanced Queue message for subsequent enqueue. This function can be used repeatedly to create a message that is longer than OVM maximum string length (255 characters). This is achieved by breaking desired message into strings up to the maximum string length, pushing the first string with is_new_statement parameter true and pushing subsequent strings with is_new_statement false (see example).
See SQLAQPUSHSTRARR for a simpler method of creating a message which is larger than the maximum string length.
Support Wozterm and Wozix
Syntax SQLAQPUSHSTRING ( int exp, bln exp, str exp )
Usage SQLAQPUSHSTRING(connection_handle, is_new_statement, string)
Parameters connection_handle - handle to database connection
is_new_statement - boolean indicating new statement; if new statement then string replaces existing message otherwise appends to existing message
string - string appending/replacing message
Return Value BOOLEAN - Indicating success or failure
Errors Error flag set if OCI not installed, database not initialised or if OCI error occurs
Example
! assume handle already established - see SQLLOGIN
@CALL SQLAQPUSHSTRING(handle, TRUE, "This is first part of message. ")
@CALL SQLAQPUSHSTRING(handle, FALSE, "This is second part of message.")

! Now enqueue "This is first part of message. This is second part of message." with correlation_ID of "Robot1" and
! priority, delay and timeout = 0
@CALL SQLEQMESSAGE(handle, SCHEMA, QUEUE, DBOBJECT, "Robot1", 0,0,0)

Back to Top


SQLBINDBYNAME

NB: To use SQL keywords Oracle's Instant Client must be installed on your workstation.
Download from http://www.oracle.com/technology/tech/oci/instantclient/instantclient.html (at time of writing)
Category Oracle Functions
Description Binds values to placeholder allocated via SQLPARSE by bind value.
See also SQLBINDBYPOS
For further information consult OCI documentation on OCIBindByName()
Support Wozterm and Wozix
Syntax SQLBINDBYNAME ( int exp, int exp, str exp, str exp )
Usage SQLBINDBYNAME(connection_handle, statement_handle, placeholder, bind_value)
Parameters connection_handle - handle to database connection
statement_handle - statement handle associated with the statement to be executed allowable values 0-31 (max 32 statement handles)
placeholder - placeholder, specified by its name, which maps to a variable in the statement associated with the statement handle
bind_value - name says it all
Return Value BOOLEAN - Indicating success or failure
Errors Error flag set if OCI not installed, database not initialised or if OCI error occurs
Example
see SQLPARSE and SQLGETFIELD

Back to Top


SQLBINDBYPOS

NB: To use SQL keywords Oracle's Instant Client must be installed on your workstation.
Download from http://www.oracle.com/technology/tech/oci/instantclient/instantclient.html (at time of writing)
Category Oracle Functions
Description Binds values to memory address allocated via SQLPARSE by column (position).
See also SQLBINDBYNAME
For further information consult OCI documentation on OCIBindByPos()
Support Wozterm and Wozix
Syntax SQLBINDBYPOS ( int exp, int exp, int exp, str exp )
Usage SQLBINDBYPOS(connection_handle, statement handle, position, bind value)
Parameters connection_handle - handle to database connection
statement_handle - statement handle associated with the statement to be executed allowable values 0-31 (max 32 statement handles)
position - placeholder number (1 indexed)
bind_value - name says it all
Return Value BOOLEAN - Indicating success or failure
Errors Error flag set if OCI not installed, database not initialised or if OCI error occurs
Example
See SQLPARSE

Back to Top


SQLCOMMIT

NB: To use SQL keywords Oracle's Instant Client must be installed on your workstation.
Download from http://www.oracle.com/technology/tech/oci/instantclient/instantclient.html (at time of writing)
Category Oracle Functions
Description Commits changes to Oracle database.
Support Wozterm and Wozix
Syntax SQLCOMMIT ( int exp )
Usage SQLCOMMIT(connection_handle)
Parameters No parameter description available
Return Value BOOLEAN - Indicating success or failure
Errors Error flag set if OCI not installed, database not initialised or if OCI error occurs
Example
see @SQLLOGIN

Back to Top


SQLDQMESSAGE

NB: To use SQL keywords Oracle's Instant Client must be installed on your workstation.
Download from http://www.oracle.com/technology/tech/oci/instantclient/instantclient.html (at time of writing)
Category Oracle Functions
Description Removes message from Oracle Advanced Queue for subsequent.
Support Wozterm and Wozix
Syntax SQLDQMESSAGE ( int exp, str exp, str exp, str exp, bln exp, str exp, int exp )
Usage SQLDQMESSAGE(connection_handle, schema, queue, db_object, browsing, correlation_ID, timeout)
Parameters See OCI documentation for further information
connection_handle - handle to database connection
schema - database schema
queue - destination queue
db_object - database object type
browsing - if true message is available for subsequent popping but does not actually remove message from queue
correlation_ID - if set dequeues first message with matching correlation ID
timeout - if no message matching criteria function will wait this number of seconds for one to become available
Return Value BOOLEAN - Indicating success or failure
Errors Error flag set if OCI not installed, database not initialised or if OCI error occurs
Example
see SQLAQPOPSTRING

Back to Top


SQLEQMESSAGE

NB: To use SQL keywords Oracle's Instant Client must be installed on your workstation.
Download from http://www.oracle.com/technology/tech/oci/instantclient/instantclient.html (at time of writing)
Category Oracle Functions
Description Enqueues message to Oracle Advanced Queue. Message should have been prepared with previous SQLAQPUSHSTRING function.
Support Wozterm and Wozix
Syntax SQLEQMESSAGE ( int exp, str exp, str exp, str exp, str exp, int exp, int exp, int exp )
Usage SQLEQMESSAGE(connection_handle, schema, queue, db_object, correlation_ID, priority, delay, timeout)
Parameters See OCI documentation for further information
connection_handle - handle to database connection
schema - database schema
queue - destination queue
db_object - database object type
correlation_ID - message identifier; if set can be used to dequeue or find a group of messages
priority - smaller number indicates higher priority
delay - number of seconds after which a message is available for dequeuing
timeout - determines, in seconds, the duration the message is available for dequeuing
Return Value BOOLEAN - Boolean indicating success
Errors Error flag set if OCI not installed, database not initialised or if OCI error occurs
Example
See SQLAQPUSHSTRING

Back to Top


SQLEXECUTE

NB: To use SQL keywords Oracle's Instant Client must be installed on your workstation.
Download from http://www.oracle.com/technology/tech/oci/instantclient/instantclient.html (at time of writing)
Category Oracle Functions
Description Execute prepared SQL statement.
Support Wozterm and Wozix
Syntax SQLEXECUTE ( int exp, int exp )
Usage SQLEXECUTE(connection_handle, statement handle)
Parameters No parameter description available
Return Value BOOLEAN - Indicating success or failure
Errors Error flag set if OCI not installed, database not initialised or if OCI error occurs
Example
insert example see SQLPARSE
select example see SQLGETFIELD

Back to Top


SQLGETFIELD

NB: To use SQL keywords Oracle's Instant Client must be installed on your workstation.
Download from http://www.oracle.com/technology/tech/oci/instantclient/instantclient.html (at time of writing)
Category Oracle Functions
Description Get field contents from current record.
As a field's contents can be longer than OVM maximum string length this function accepts a string array as it's last parameter. The first element in the array will contain the first 255 characters in the message the second will contain the next 255 characters and so on.
Support Wozterm and Wozix
Syntax SQLGETFIELD ( int exp, int exp, int exp, 1 dimensional str array [, int var [, int var [, int var]]] )
Usage SQLGETFIELD(connection_handle, statement index, column number, field (array of OVM strings to accommodate large field) [, total_chars_popped [, number_OVMstrings_in_array] [, chars_in_last_string]] )
Parameters No parameter description available
Return Value BOOLEAN - Indicating success or failure
Errors Error flag set if OCI not installed, database not initialised or if OCI error occurs
Example
! assume connection handle already established - see SQLLOGIN

! run select query for to get first 500 records
@COMMENT("Parse 1 = ", SQLPARSE(hdle, stmntIndex, TRUE, "SELECT * FROM TEST WHERE "))
@COMMENT("Parse 2 = ", SQLPARSE(hdle, stmntIndex, FALSE, "rownum < :NUM" ))
@COMMENT("Bind = ", SQLBINDBYNAME(hdle, stmntIndex , ":NUM", "500"))
@COMMENT("Execute = ", SQLEXECUTE(hdle, stmntIndex) )

@COMMENT("Field Count = ", SQLGETFIELDCOUNT(hdle, stmntIndex))

! now display 'em
@INTEGER recNum = 0
@WHILE (SQLNEXT(hdle, stmntIndex)) DO
@BEGIN
	@INC(recNum)
	@COMMENT("<", recNum, ">")
	@FOR INTEGER colNum = 1 TO SQLGETFIELDCOUNT(hdle, stmntIndex)
	@BEGIN
		@CONSTANT INTEGER fieldArraySize = 17
		@STRING column, field[fieldArraySize]
		@SQLGETFIELDNAME(hdle, stmntIndex, colNum, column)
		@SQLGETFIELD(hdle, stmntIndex, colNum, field)
		@DISPLAY("<", column, "> ")
		@FOR INTEGER i = 1 TO fieldArraySize
		@BEGIN
		@IF field[i] = "" THEN ENDLOOP
		@ELSE DISPLAY(field[i])
		@END
		@COMMENT(" <", column , ">")
	@END
	@COMMENT("<", recNum, ">")
@END
@IF recNum = 0 THEN @COMMENT("No Records Found")

Back to Top


SQLGETFIELDCOUNT

NB: To use SQL keywords Oracle's Instant Client must be installed on your workstation.
Download from http://www.oracle.com/technology/tech/oci/instantclient/instantclient.html (at time of writing)
Category Oracle Functions
Description Get number of columns in record set.
Support Wozterm and Wozix
Syntax SQLGETFIELDCOUNT ( int exp, int exp )
Usage SQLGETFIELDCOUNT(connection_handle, statement index)
Parameters No parameter description available
Return Value INTEGER - Number of fields (columns) in record set
Errors Error flag set if OCI not installed, database not initialised or if OCI error occurs
Example
see SQLGETFIELD

Back to Top


SQLGETFIELDNAME

NB: To use SQL keywords Oracle's Instant Client must be installed on your workstation.
Download from http://www.oracle.com/technology/tech/oci/instantclient/instantclient.html (at time of writing)
Category Oracle Functions
Description Get field name from current record.
Support Wozterm and Wozix
Syntax SQLGETFIELDNAME ( int exp, int exp, int exp, str var )
Usage SQLGETFIELDNAME(connection_handle, statement index, column number, field name)
Parameters No parameter description available
Return Value BOOLEAN - Indicating success of failure
Errors Error flag set if OCI not installed, database not initialised or if OCI error occurs
Example
see SQLGETFIELD

Back to Top


SQLLOGIN

NB: To use SQL keywords Oracle's Instant Client must be installed on your workstation.
Download from http://www.oracle.com/technology/tech/oci/instantclient/instantclient.html (at time of writing)
Category Oracle Functions
Description Login to Oracle database.
See also @SQLLOGOUT
Support Wozterm and Wozix
Syntax SQLLOGIN ( int var, str exp, str exp, str exp )
Usage SQLLOGIN(connection_handle, username, password, TNSC)
Parameters No parameter description available
Return Value BOOLEAN - Indicating success or failure
Errors Error flag set if OCI not installed, database cannot be initialised or if OCI error occurs
Example
@INTEGER handle = -1
@CONSTANT STRING USER     = "<username>"
@CONSTANT STRING PASS     = "<password>"
@CONSTANT STRING TNSC     = "//<IP address>:<port>/<tnsc>" 	! substitute your values for all "<>"

! login
@CALL SQLLOGIN(handle, USER, PASS, TNSC)

! do stuff - insert/delete/select/update records, do message stuff etc,

! commit or rollback changes to database
@IF happyWithStuff THEN					! pseudo code (happyWithStuff not declared)
	@SQLCOMMIT(handle)
@ELSE
	@SQLROLLBACK(handle)

! once done logout
@SQLLOGOUT(handle)

Back to Top


SQLLOGOUT

NB: To use SQL keywords Oracle's Instant Client must be installed on your workstation.
Download from http://www.oracle.com/technology/tech/oci/instantclient/instantclient.html (at time of writing)
Category Oracle Functions
Description Log out from Oracle database.
Support Wozterm and Wozix
Syntax SQLLOGOUT ( int exp )
Usage SQLLOGOUT(connection_handle)
Parameters No parameter description available
Return Value BOOLEAN - Indicating success or failure
Errors Error flag set if OCI not installed, database not initialised or if OCI error occurs
Example
see @SQLLOGIN

Back to Top


SQLNEXT

NB: To use SQL keywords Oracle's Instant Client must be installed on your workstation.
Download from http://www.oracle.com/technology/tech/oci/instantclient/instantclient.html (at time of writing)
Category Oracle Functions
Description Get next record in set returned by SQLEXECUTE.
Support Wozterm and Wozix
Syntax SQLNEXT ( int exp, int exp )
Usage SQLNEXT(connection_handle, statement index)
Parameters No parameter description available
Return Value BOOLEAN - Indicating success or failure
Errors Error flag set if OCI not installed, database not initialised or if OCI error occurs
Example
see SQLGETFIELD

Back to Top


SQLPARSE

NB: To use SQL keywords Oracle's Instant Client must be installed on your workstation.
Download from http://www.oracle.com/technology/tech/oci/instantclient/instantclient.html (at time of writing)
Category Oracle Functions
Description Prepare SQL statement for subsequent execution.
This function can be used repeatedly to prepare an SQL statement which is longer than OVM maximum string length (255 characters). This is achieved by breaking desired SQL statement into strings up to the maximum string length and calling this function with the first string and the is_new_statement parameter set to true. The remaining strings are then passed to this function with is_new_statement set to false (see example).
For further information see OCI documentation for OCIStmtPrepare()
Support Wozterm and Wozix
Syntax SQLPARSE ( int exp, int exp, bln exp, str exp )
Usage SQLPARSE(connection_handle, statement_index, is_new_statement, SQL_string)
Parameters connection_handle - handle to database connection
statement_index - statement index (must be >= 0) associated with the statement to be executed allowable values 0-31 (max 32 statement handles)
is_new_statement - boolean indicating new statement; if new statement then string replaces existing SQL statement otherwise appends to existing statement
SQL_string - part or whole SQL string
Return Value BOOLEAN - Indicating success or failure
Errors Error flag set if OCI not installed, database not initialised or if OCI error occurs
Example
@INTEGER stmntHandle = 0

! assume connection handle already established - see SQLLOGIN

! Prepare SQL statement that will be the result of concatenation of the next 5 SQL_strings
@CALL SQLPARSE(connection_handle, stmntIndex, TRUE, "INSERT INTO TEST (tid,stuff,mydate)")
@CALL SQLPARSE(connection_handle, stmntIndex, FALSE, "VALUES (")
@CALL SQLPARSE(connection_handle, stmntIndex, FALSE, "TO_NUMBER(:ABC, '99999.99')")
@CALL SQLPARSE(connection_handle, stmntIndex, FALSE, ", :ID2")
@CALL SQLPARSE(connection_handle, stmntIndex, FALSE, ",TO_DATE(:DTE, 'yyyymmddhh24miss'))")

! bind "1" to placeholder ":ABC"
@CALL SQLBINDBYNAME(connection_handle, stmntIndex, ":ABC", "1")
! bind "This is a test" to placeholder ":ID2"
@CALL SQLBINDBYNAME(connection_handle, stmntIndex, ":ID2", "This is a test"
! bind current date/time to 3rd placeholder (same effect as bind by name on ":DTE")
@CALL SQLBINDBYPOS (connection_handle, stmntIndex, 3,      COPY(GETDATETIME(),1,14))
! execute prepared statement
@CALL SQLEXECUTE(connection_handle, stmntIndex)

Back to Top


SQLROLLBACK

NB: To use SQL keywords Oracle's Instant Client must be installed on your workstation.
Download from http://www.oracle.com/technology/tech/oci/instantclient/instantclient.html (at time of writing)
Category Oracle Functions
Description Rollback uncommitted transactions.
Support Wozterm and Wozix
Syntax SQLROLLBACK ( int exp )
Usage SQLROLLBACK(connection_handle)
Parameters No parameter description available
Return Value BOOLEAN - Indicating success or failure
Errors Error flag set if OCI not installed, database not initialised or if OCI error occurs
Example
see @SQLLOGIN

Back to Top


@STOP

Category Program Handling Functions
Description Immediately halts script execution and unloads script.
Support Wozterm and Wozix
Syntax @STOP
Usage @STOP
Parameters None
Return Value None
Errors This keyword does not set the error flag.
Example
@integer test = 1
....
@if test = 1 then goto finished
....

@label finished
@STOP

Back to Top


STR

Category Data Manipulation Functions
Description Convert an integer value to its decimal string equivalent.
Support Wozterm and Wozix
Syntax STR ( int exp )
Usage STR(int_val)
Parameters int_val - Integer value to be converted to the string equivalent.
Return Value STRING - Decimal string
Errors This keyword does not set the error flag.
Example
@string test
@for integer x = 0 to 255
@begin
  @comment(x,'(',hex(x,2),')',' = ',chr(x))
  @set test = STR(x)
  @if copy(test,length(test),1) = '0' then prompt
@end

Back to Top


STRARRAYCHARS

Category Data Manipulation Functions
Description Returns the number of characters in a single dimension string array.
Support Wozterm and Wozix
Syntax STRARRAYCHARS ( 1 dimensional str array )
Usage STRARRAYCHARS(string_array)
Parameters string_array - Single dimension array name to be checked for the number of characters.
Return Value INTEGER - Number of characters in array
Errors This keyword does not set the error flag.
Example
@string array[10]

@for integer a = 1 to 10
@begin
  @set array[a] = str(a)
  @comment(array[a])
@end

@comment('Number of characters in "array" = ',STRARRAYCHARS(array))

Back to Top


STRARRAYCONCAT

Category Data Manipulation Functions
Description Adds the contents of one single dimension string array to another.
Note: This function will only add as many characters as will fit from the source array to the destination array. It will not set the error flag if there are characters left over but you can use the return value to ascertain what has happened.
Support Wozterm and Wozix
Syntax STRARRAYCONCAT ( 1 dimensional str array, 1 dimensional str array )
Usage STRARRAYCONCAT(string_array_dest, string_array_src )
Parameters string_array_dest - Destination single dimension array to be appended to.
string_array_src - Source single dimension array to be concatenated to the destination array.
Return Value INTEGER - number of characters concatenated
Errors This keyword does not set the error flag.
Example
@string array[10], array2[20]
@integer a, result

@for a = 1 to 10
@begin
  @set array[a] = str(a)
  @set array2[a] = str(a)
  @comment('array = ',array[a],', array2 = ',array2[a])
@end

@comment('Number of characters in "array" = ',STRARRAYCHARS(array))
@comment('Number of characters in "array2" = ',STRARRAYCHARS(array2))

@set result = STRARRAYCONCAT(array2, array)
@comment('Number of characters added to "array2" = ',result)
@comment('Number of characters now in "array2" = ',STRARRAYCHARS(array2))

Back to Top


STRARRAYCOPY

NB: This keyword is still being beta tested and is not available with the released version of Wozterm
Category Currently Beta Testing
Description Copies a substring of the source strarray to the destination strarray. If source is shorter than number of characters specified then the whole of source is popped and return value will be the length of source.
Support Wozterm and Wozix
Syntax STRARRAYCOPY ( 1 dimensional str array, 1 dimensional str array, int exp, int exp )
Usage STRARRAYCOPY(string array destination, string array source, integer offset, integer length)
Parameters No parameter description available
Return Value INTEGER - Number of characters actually copied
Errors This keyword does not set the error flag.
Example
No example script segment available

Back to Top


@STRARRAYFLUSH

Category Data Manipulation Functions
Description Clear the contents of a 1 dimensional string array.
Support Wozterm and Wozix
Syntax @STRARRAYFLUSH ( 1 dimensional str array )
Usage STRARRAYFLUSH(string array)
Parameters No parameter description available
Return Value None
Errors This keyword does not set the error flag.
Example
No example script segment available

Back to Top


STRARRAYPMATCH

Category Data Manipulation Functions
Description Looks for matching patterns in data stored in string array.
See also PATTERNCREATE, PATTERNDESTROY, PATTERNDESTROYALL, PATTERNLEVEL & PATTERNMATCH
This function checks against patterns defined PATTERNCREATE and checks them against the data in the string array in order of precedence. This works by checking for the first match against any of the patterns. If 2 patterns get a match at the same point in the string then a match is returned against the pattern of the highest precedence. Positions of the first and last matching characters can be found by passing these parameters by reference. To understand this it is important to see the examples below that show results of different permutations.
Support Wozterm and Wozix
Syntax STRARRAYPMATCH ( int exp, 1 dimensional str array [, int var [, int var]] )
Usage STRARRAYPMATCH(pattern handle, data buffer, position last character in matching pattern, position first character in matching pattern)
Parameters No parameter description available
Return Value INTEGER - 0 no match, 1... number of matching pattern
Errors This keyword does not set the error flag.
Example
! assume buffer is a string array containing "ab0zz12ayss1bs345s34s3sssssssss"

@integer ptnstart, ptnend, ptnmatched

! single pattern of 1 char
@integer h1 = PATTERNCREATE("0")
@ptnmatched = STRARRAYPMATCH(h1,buffer,ptnend,ptnstart)
! RESULT: ptnmatched = 1, ptnend = 3 and ptnstart = 3


! 2 ptns with single matching coming up first
@integer h2 = PATTERNCREATE("0","12")
@ptnmatched = STRARRAYPMATCH(h2,buffer,ptnend,ptnstart)
! RESULT: ptnmatched = 1, ptnend = 3 and ptnstart = 3

! patterns starting with same character first longer than other
! with match coming on 2nd pattern
@integer h3 = PATTERNCREATE("13","1")
@ptnmatched = STRARRAYPMATCH(h3,buffer,ptnend,ptnstart)
! RESULT: ptnmatched = 2, ptnend = 6 and ptnstart = 6

! patterns starting with same character first 2 chars than other 1 char
! matches both but match returned on 1st cos it has precedence
@integer h4 = PATTERNCREATE("12","1")
@ptnmatched = STRARRAYPMATCH(h4,buffer,ptnend,ptnstart)
! RESULT: ptnmatched = 1, ptnend = 7 and ptnstart = 6

! 3 patterns all starting same char with the following lengths 3,2,1
! match on all but match returned on 1st cos it has precedence
@integer h5 = PATTERNCREATE("345","34","3")
@ptnmatched = STRARRAYPMATCH(h5,buffer,ptnend,ptnstart)
! RESULT: ptnmatched = 1, ptnend = 17 and ptnstart = 15

! 3 patterns all starting same char with the following lengths 3,2,1
! match on last two but match returned on 2nd cos it has precedence
@integer h6 = PATTERNCREATE("346","34","3")
@ptnmatched = STRARRAYPMATCH(h6,buffer,ptnend,ptnstart)
! RESULT: ptnmatched = 2, ptnend = 16 and ptnstart = 15

! 3 patterns all starting same char with the following lengths 3,2,1
! match on first & last but match returned on 1st cos it has precedence
@integer h7 = PATTERNCREATE("345","36","3")
@ptnmatched = STRARRAYPMATCH(h7,buffer,ptnend,ptnstart)
! RESULT: ptnmatched = 1, ptnend = 17 and ptnstart = 15

! 3 patterns all starting same char with the following lengths 3,4,1
! match on first & last but match returned on 1st cos it has precedence
@integer h8 = PATTERNCREATE("345","3457","3")
@ptnmatched = STRARRAYPMATCH(h8,buffer,ptnend,ptnstart)
! RESULT: ptnmatched = 1, ptnend = 17 and ptnstart = 15

Back to Top


STRARRAYPOP

Category Data Manipulation Functions
Description Pops specified number of characters from source to destination string array. If source is shorter than number of characters specified then the whole of source is popped and return value will be the length of source.
Support Wozterm and Wozix
Syntax STRARRAYPOP ( 1 dimensional str array, 1 dimensional str array, int exp )
Usage STRARRAYPOP(string array destination, string array source, integer number of characters to pop)
Parameters No parameter description available
Return Value INTEGER - Number of characters actually popped
Errors This keyword does not set the error flag.
Example
No example script segment available

Back to Top


STRARRAYPUSH

NB: This keyword is still being beta tested and is not available with the released version of Wozterm
Category Currently Beta Testing
Description Pushes the source strarray onto the destination strarray If source is shorter than number of characters specified then the whole of source is popped and return value will be the length of source.
Support Wozterm and Wozix
Syntax STRARRAYPUSH ( 1 dimensional str array, 1 dimensional str array )
Usage STRARRAYPUSH(string array destination, string array source)
Parameters No parameter description available
Return Value INTEGER - Number of characters actually pushed
Errors This keyword does not set the error flag.
Example
No example script segment available

Back to Top


@STRARRAYTRIM

Category Data Manipulation Functions
Description Trims specified characters from a string array.
By default (if only one the string array alone is passed as a parameter) STRARRAYTRIM trims whitespace from the start and end of the string array.
If you wish to trim white space from the start or end pass the keywords STRLEFT/STRRIGHT as the second parameter. STRBOTH as second parameter trims both left and right.
If you wish to trim one or more specified characters from a string array pass the ASCII code of the characters in the subsequent optional parameters.
Support Wozterm and Wozix
Syntax @STRARRAYTRIM ( 1 dimensional str array [, int exp [, int exp [, matching exp...]]] )
Usage STRARRAYTRIM(string array[, STRLEFT or STRRIGHT or STRBOTH[, 1st ASCII value][, 2nd ASCII value][, ...]])
Parameters No parameter description available
Return Value None
Errors Error flag is set if invalid value passed as second parameter
Example
! Trim whitespace from start & end of string array
@STRARRAYTRIM(strarray)

! Trim whitespace from start of string array
@STRARRAYTRIM(strarray,STRLEFT)

! Trim whitespace from end of string array
@STRARRAYTRIM(strarray,STRRIGHT)

! Trim tabs, whitespace, carriage return & line feeds
! from start & end of string
@STRARRAYTRIM(strarray,STRBOTH,9,32,13,10)

! Trim tabs, whitespace, carriage return & line feeds
! from start of string
@STRARRAYTRIM(strarray,STRLEFT,9,32,13,10)

Back to Top


@STRARRAYTRUNC

Category Data Manipulation Functions
Description Truncates a string array to specified length. If desired length is greater than number of bytes in the string array then this command has no effect and if the length specified is 0 or less then the array is flushed.
Support Wozterm and Wozix
Syntax @STRARRAYTRUNC ( 1 dimensional str array, int exp )
Usage STRARRAYTRUNC(string array, desired length)
Parameters No parameter description available
Return Value None
Errors This keyword does not set the error flag.
Example
No example script segment available

Back to Top


STRBOTH

Category Data Manipulation Functions
Description Used with @STRARRAYTRIM to specify trim from start or end of string. See also @STRARRAYTRIM.
Support Wozterm and Wozix
Syntax STRBOTH
Usage @STRARRAYTRIM(buffer,STRBOTH)
Parameters None
Return Value INTEGER
Errors This keyword does not set the error flag.
Example
No example script segment available

Back to Top


STRCONCAT

Category Data Manipulation Functions
Description Concatenates 2 or more expressions together as string values, up to a maximum 255 characters. STRCONCAT converts any non-string parameters passed to it to a string representation before concatenation occurs. CONCAT is an alias for STRCONCAT.
Note: The '+' operator can also be used to concatenate strings.
Support Wozterm and Wozix
Syntax STRCONCAT ( exp, exp [, exp...] )
Usage STRCONCAT ( text, text [ , text ... ] )
Parameters text - Two of more variables or string constants each separated by a comma.
Return Value STRING - The concatenation of all parameters.
Errors This keyword does not set the error flag.
Example
@STRING temp, EXE_DIR
@SAVEDIR(EXE_DIR)
@EXE_DIR = COPY(EXE_DIR,1,POS("\",EXE_DIR,LAST))
@INPUT(temp,"Please enter new log name:")
@LOG(STRCONCAT(EXE_DIR,"LOGS\",temp,".log"))
@SET buffer = GETLOG()
@COMMENT("New log file is '",temp,"'")

Back to Top


STRCOPY

Category Data Manipulation Functions
Description Returns a substring of a string. STRCOPY will copy up to the end of the string, or truncate at 255 characters, whichever comes first. No characters returned if copying after the end of the string. COPY is an alias for STRCOPY.
Support Wozterm and Wozix
Syntax STRCOPY ( str exp, int exp, int exp )
Usage STRCOPY ( source_string, start_position, copy_length )
Parameters source_string - Main string from which to extract the substring.
start_position - Point of 'source_string' to start copying.
copy_length - Number of characters past 'start_position' to be copied.
Return Value STRING - A substring of 'source_string'. The substring will be 'copy_length' characters long starting from position 'start_position'.
Errors This keyword does not set the error flag.
Example
@STRING date_time
@GETDATE(date_time)
@STRING date = STRCOPY(date_time,1,8)
@STRING time = CONCAT(STRCOPY(date_time,9,2),":",STRCOPY(date_time,11,2))
@STRING day = STRCOPY(date_time,15,3)
@COMMENT(" * Check PC time and date..")
@COMMENT(" DATE=",date," DAY=",day," TIME=",time)

Back to Top


@STREAMBREAK

Category Stream Functions
Description Send a break on the data stream.
Support Wozix
Syntax @STREAMBREAK ( int exp )
Usage @STREAMBREAK(stream handle)
Parameters No parameter description available
Return Value None
Errors This keyword does not set the error flag.
Example
No example script segment available

Back to Top


STREAMCREATE

Category Stream Functions
Description Create a data stream.
Support Wozix
Syntax STREAMCREATE ( str exp, str exp, str exp, int exp [, str exp [, bln exp]] )
Usage STREAMCREATE(type, destination, options, line buffer size [, logfile name [, filter nuls]])
Parameters No parameter description available
Return Value INTEGER - Stream handle
Errors This keyword does not set the error flag.
Example
No example script segment available

Back to Top


@STREAMDESTROY

Category Stream Functions
Description Destroys a data stream.
Support Wozix
Syntax @STREAMDESTROY ( int exp )
Usage @STREAMDESTROY(stream handle)
Parameters No parameter description available
Return Value None
Errors This keyword does not set the error flag.
Example
No example script segment available

Back to Top


@STREAMDESTROYALL

Category Stream Functions
Description Destroys all data streams.
Support Wozix
Syntax @STREAMDESTROYALL
Usage @STREAMDESTROYALL
Parameters None
Return Value None
Errors This keyword does not set the error flag.
Example
No example script segment available

Back to Top


STREAMEVENT

Category Stream Functions
Description Process a stream event.
Support Wozix
Syntax STREAMEVENT ( int exp, int exp, str exp )
Usage STREAMEVENT(stream handle, event type, data)
Parameters No parameter description available
Return Value INTEGER - Application specific return code
Errors This keyword does not set the error flag.
Example
No example script segment available

Back to Top


@STREAMFLUSHIN

Category Stream Functions
Description Flushes (discards) data from the stream's input buffer.
Support Wozix
Syntax @STREAMFLUSHIN ( int exp )
Usage @STREAMFLUSHIN(stream handle)
Parameters No parameter description available
Return Value None
Errors This keyword does not set the error flag.
Example
No example script segment available

Back to Top


@STREAMFLUSHOUT

Category Stream Functions
Description Flushes (sends) data in the stream's output buffer.
Support Wozix
Syntax @STREAMFLUSHOUT ( int exp )
Usage @STREAMFLUSHOUT(stream handle)
Parameters No parameter description available
Return Value None
Errors This keyword does not set the error flag.
Example
No example script segment available

Back to Top


STREAMGETARRAY

Category Stream Functions
Description Read characters (bytes) from the stream into a string array.
Support Wozix
Syntax STREAMGETARRAY ( int exp, 1 dimensional str array )
Usage STREAMGETBUFF(stream handle, string array)
Parameters No parameter description available
Return Value INTEGER - Number of bytes read
Errors This keyword does not set the error flag.
Example
No example script segment available

Back to Top


STREAMGETAVAIL

Category Stream Functions
Description Returns number of bytes waiting to be read, with optional timeout.
Support Wozix
Syntax STREAMGETAVAIL ( int exp [, int exp] )
Usage STREAMGETAVAIL(stream handle [, timeout in milliseconds])
Parameters No parameter description available
Return Value INTEGER - Number of bytes available to be read
Errors This keyword does not set the error flag.
Example
No example script segment available

Back to Top


STREAMGETBUFF

Category Stream Functions
Description Read characters (bytes) from the stream.
Support Wozix
Syntax STREAMGETBUFF ( int exp, str var, int exp )
Usage STREAMGETBUFF(stream handle, data variable name, maximum number of bytes to get)
Parameters No parameter description available
Return Value INTEGER - Number of bytes read
Errors This keyword does not set the error flag.
Example
No example script segment available

Back to Top


STREAMGETBYTE

Category Stream Functions
Description Read a single character/byte from the stream.
Support Wozix
Syntax STREAMGETBYTE ( int exp, int var )
Usage STREAMGETBYTE(stream handle, data variable name)
Parameters No parameter description available
Return Value INTEGER - < 0 error, 0 no data available, 1 success
Errors This keyword does not set the error flag.
Example
No example script segment available

Back to Top


STREAMGETLINE

Category Stream Functions
Description Read a line of data from the stream up to and including the line terminating character.
Support Wozix
Syntax STREAMGETLINE ( int exp, str var [, int exp] )
Usage STREAMGETLINE(stream handle, data variable name [, terminating character])
Parameters No parameter description available
Return Value INTEGER - Number of bytes read
Errors This keyword does not set the error flag.
Example
No example script segment available

Back to Top


STREAMGETPARAM

Category Stream Functions
Description Not implemented.
Support Wozix
Syntax STREAMGETPARAM ( int exp, str exp )
Usage STREAMGETPARAM(stream handle, parameter name)
Parameters No parameter description available
Return Value STRING - Parameter value
Errors This keyword does not set the error flag.
Example
No example script segment available

Back to Top


STREAMGETSTATUS

Category Stream Functions
Description Returns the value of the stream's status flag.
Support Wozix
Syntax STREAMGETSTATUS ( int exp )
Usage STREAMGETSTATUS(stream handle)
Parameters No parameter description available
Return Value INTEGER - Stream status
Errors This keyword does not set the error flag.
Example
No example script segment available

Back to Top


STREAMLASTMSGSRC

Category Stream Functions
Description Gets the source of the last message
Support Wozix
Syntax STREAMLASTMSGSRC ( int exp )
Usage STREAMLASTMSGSRC()
Parameters No parameter description available
Return Value STRING - Source name
Errors This keyword does not set the error flag.
Example
No example script segment available

Back to Top


STREAMLBEND

Category Stream Functions
Description Returns the line number of the newest line of data in the stream's line buffer.
Support Wozix
Syntax STREAMLBEND ( int exp )
Usage STREAMLBEND(stream handle)
Parameters No parameter description available
Return Value INTEGER - Line number
Errors This keyword does not set the error flag.
Example
No example script segment available

Back to Top


@STREAMLBFLUSH

Category Stream Functions
Description Flushes the streams line buffer of all data. Resets STREAMLBEND, STREAMLBSTART.
Support Wozix
Syntax @STREAMLBFLUSH ( int exp )
Usage @STREAMLBFLUSH(stream handle)
Parameters No parameter description available
Return Value None
Errors This keyword does not set the error flag.
Example
No example script segment available

Back to Top


STREAMLBGET

Category Stream Functions
Description Returns the contents of the specified line in the stream's line buffer. See also STREAMLBEND and STREAMLBSTART.
Support Wozix
Syntax STREAMLBGET ( int exp, int exp )
Usage STREAMLBGET(stream handle, line number)
Parameters No parameter description available
Return Value STRING - Contents of line
Errors This keyword does not set the error flag.
Example
No example script segment available

Back to Top


STREAMLBSCAN

Category Stream Functions
Description Searches the stream's line buffer. Uses the value set by @PATTERNLEVEL to determine if pattern is case sensitive.
Support Wozix
Syntax STREAMLBSCAN ( int exp, str exp, int var [, int exp [, int exp [, int exp [, int exp]]]] )
Usage STREAMLBSCAN(stream_handle, target, column [, 1st_column [, last_column [, 1st_row [, last_row]]]])
Parameters No parameter description available
Return Value INTEGER - Line number
Errors This keyword does not set the error flag.
Example
No example script segment available

Back to Top


STREAMLBSTART

Category Stream Functions
Description Returns the line number of the oldest line of data in the stream's line buffer.
Support Wozix
Syntax STREAMLBSTART ( int exp )
Usage STREAMLBSTART(stream handle)
Parameters No parameter description available
Return Value INTEGER - Line number
Errors This keyword does not set the error flag.
Example
No example script segment available

Back to Top


@STREAMLOG

Category Stream Functions
Description Specify stream logfile name and begin/end logging.
Support Wozix
Syntax @STREAMLOG ( int exp, str exp )
Usage @STREAMLOG(stream handle, logfile name)
Parameters No parameter description available
Return Value None
Errors This keyword does not set the error flag.
Example
No example script segment available

Back to Top


@STREAMPUT

Category Stream Functions
Description Sends data using the stream.
Support Wozix
Syntax @STREAMPUT ( int exp, int/str exp, [, int/str exp...] )
Usage @STREAMPUT(stream handle, data [, ...])
Parameters No parameter description available
Return Value None
Errors This keyword does not set the error flag.
Example
No example script segment available

Back to Top


@STREAMPUTARRAY

Category Stream Functions
Description Sends data using the stream.
Support Wozix
Syntax @STREAMPUTARRAY ( int exp, 1 dimensional str array )
Usage @STREAMPUTARRAY(stream handle, string array)
Parameters No parameter description available
Return Value None
Errors This keyword does not set the error flag.
Example
No example script segment available

Back to Top


@STREAMPUTBYTE

Category Stream Functions
Description Puts the ASCII equivalent byte(s) onto the stream.
Support Wozix
Syntax @STREAMPUTBYTE ( int exp, int exp [, matching exp...] )
Usage @STREAMPUTBYTE(stream handle, byte [, ...])
Parameters No parameter description available
Return Value None
Errors This keyword does not set the error flag.
Example
No example script segment available

Back to Top


@STREAMSETPARAM

Category Stream Functions
Description Sets the value of an application specific stream parameter.
Support Wozix
Syntax @STREAMSETPARAM ( int exp, str exp, int exp )
Usage @STREAMSETPARAM(stream handle, parameter name, value)
Parameters No parameter description available
Return Value None
Errors This keyword does not set the error flag.
Example
No example script segment available

Back to Top


@STREAMSETSTATUS

Category Stream Functions
Description Sets the value of the stream's status flag.
Support Wozix
Syntax @STREAMSETSTATUS ( int exp, int exp )
Usage @STREAMSETSTATUS(stream handle, value)
Parameters No parameter description available
Return Value None
Errors This keyword does not set the error flag.
Example
No example script segment available

Back to Top


STREAMWAITFOR

Category Stream Functions
Description Wait for any of the specified strings/patterns to be received by the stream. Uses the value set by @PATTERNLEVEL to determine if pattern is case sensitive.
Support Wozix
Syntax STREAMWAITFOR ( int exp, int exp, str exp [, matching exp...] )
Usage STREAMWAITFOR(stream handle, timeout in milliseconds, 1st pattern [, ...])
Parameters No parameter description available
Return Value INTEGER - 0 - time out, 1.. pattern matched
Errors This keyword does not set the error flag.
Example
No example script segment available

Back to Top


@STRING

Category Program Handling Functions
Description Used to define string type variables and arrays. The maximum number of characters each string can store is 255. If not explicitly set, the variable will be initialised with the compiler's default value of "" (empty string). See also DEFAULTVALUE. For examples and further information on using variables, refer to Variables
Support Wozterm and Wozix
Syntax @STRING var_name [ [ DEFAULTVALUE ] = str exp ]
Usage @STRING var_name [ [ DEFAULTVALUE ] = value ]
Parameters var_name - The name to assigned to the variable consisting of up to 30 characters (a - z, A - Z, _, 0 - 9) starting with a letter or an underscore.
DEFAULTVALUE (optional) - to assign a specific default value to the variable at compile time.
value (optional) - Literal, variable or expression which evaluates to a string value.
Return Value None
Errors This keyword does not set the error flag.
Example
@STRING time
@STRING today = getdatetime()
@STRING dir defaultvalue = 'C:'

Back to Top


STRLEFT

Category Data Manipulation Functions
Description Used with STRARRAYTRIM to specify trim start of string. See also @STRARRAYTRIM
Support Wozterm and Wozix
Syntax STRLEFT
Usage @STRARRAYTRIM(buffer,STRLEFT)
Parameters None
Return Value INTEGER
Errors This keyword does not set the error flag.
Example
No example script segment available

Back to Top


STRLENGTH

Category Data Manipulation Functions
Description Returns the length of a string in characters/bytes. Performs same function as LENGTH
Support Wozterm and Wozix
Syntax STRLENGTH ( str exp )
Usage STRLENGTH(string)
Parameters No parameter description available
Return Value INTEGER - Number of characters
Errors This keyword does not set the error flag.
Example
@INTEGER test = STRLENGTH("")
@COMMENT(test)			! outputs 0

@test = STRLENGTH("abcde")
@COMMENT(test)			! outputs 5

Back to Top


STRLOWCASE

Category Data Manipulation Functions
Description Returns the lower case version of a string. Performs same function as LOWCASE
Support Wozterm and Wozix
Syntax STRLOWCASE ( str exp )
Usage STRLOWCASE(string)
Parameters No parameter description available
Return Value STRING - Lower case string
Errors This keyword does not set the error flag.
Example
@string mixed = 'AaBbcC1234_vV'
@comment(mixed)
@string lower = STRLOWCASE(mixed)
@comment(lower)

Back to Top


STRPOS

Category Data Manipulation Functions
Description Returns the position of a substring within a string , optional parameter specifies occurrence. Uses the value set by @PATTERNLEVEL to determine if pattern is case sensitive. Performs same function as POS.
Support Wozterm and Wozix
Syntax STRPOS ( str exp, str exp [, int exp] )
Usage STRPOS(substring, string [, occurrence])
Parameters No parameter description available
Return Value INTEGER - Character/byte position
Errors This keyword does not set the error flag.
Example
@string textToSearch = '123456789012345678901234567890'
@integer position

@position = STRPOS('3',textToSearch) 			!position = 3
@comment('First "3" is at position ',position,' in ',textToSearch)

Back to Top


STRREPLACE

Category Data Manipulation Functions
Description Substitute specified characters of the 1st string with the 2nd string.
Support Wozterm and Wozix
Syntax STRREPLACE ( str exp, int exp, int exp, str exp )
Usage STRREPLACE(1st_string, start_pos, num_chars, 2nd_string)
Parameters 1st_string - This is the initial string that contains the characters you want to have replaced.
start_pos - Start position in the '1st_string' from where you want the old character(s) replaced with the character(s) in '2nd_string'.
num_chars - The number of characters that will be replaced by '2nd_string'.
2nd_string - This is the string that will replace the initial characters in '1st_string'.
Return Value STRING - New string
Errors This keyword does not set the error flag.
Example
@string host = "my-server0.telstra.com"
@comment(host)
@string h2 = UPCASE(host)
@for integer i = 1 to length(h2)
  @begin  ! replace non-alphanumeric chars with '_'
    @string c = copy(h2, i, 1)
    @if ((c >= 'A') and (c <= 'Z')) then
      @NEXTLOOP
    @if ((c >= '0') and (c <= '9')) then
      @NEXTLOOP
    @set h2 = STRREPLACE(h2, i, 1, '_')
  @end
@comment(h2)

!This code outputs the following:
!my-server0.telstra.com
!MY_SERVER0_TELSTRA_COM

Back to Top


STRRIGHT

Category Data Manipulation Functions
Description Used with @STRARRAYTRIM to specify trim end of string. See also @STRARRAYTRIM.
Support Wozterm and Wozix
Syntax STRRIGHT
Usage @STRARRAYTRIM(buffer,STRRIGHT)
Parameters None
Return Value INTEGER
Errors This keyword does not set the error flag.
Example
No example script segment available

Back to Top


STRSTRIP

Category Data Manipulation Functions
Description Remove the characters listed in the 2nd string from the 1st string.
Support Wozterm and Wozix
Syntax STRSTRIP ( str exp, str exp )
Usage STRSTRIP(string, chars_to_strip)
Parameters string - String to be stripped of the specified characters.
chars_to_strip - Character(s) to be stripped from the specified string.
Return Value STRING - Stripped string
Errors This keyword does not set the error flag.
Example
@set S12NE_Header1 = reply(scan(NE_NAME))
@set S12NE_Header1 = STRTRIM(STRSTRIP(S12NE_Header1,`\n\r\$08\$0C\$04\$05\$17`))

Back to Top


STRTOEPOCH

Category Date & Time Functions
Description Returns the Unix epoch timestamp of the given time string
Support Wozterm and Wozix
Syntax STRTOEPOCH ( str exp )
Usage @int epoch = STRTOEPOCH ('20061212')
Parameters No parameter description available
Return Value INTEGER - Unix epoch timestamp
Errors This keyword does not set the error flag.
Example
No example script segment available

Back to Top


STRTRIM

Category Data Manipulation Functions
Description Removes leading and trailing whitespace from a string. Performs same function as TRIM
Support Wozterm and Wozix
Syntax STRTRIM ( str exp )
Usage STRTRIM(string)
Parameters string - String to be stripped of leading and trailing whitespace.
Return Value STRING - Trimmed string
Errors This keyword does not set the error flag.
Example
@STRING x = " blah blah    "
@comment(">",x,"<")
@STRTRIM(x)
! x will now equal "blah blah"
@comment(">",x,"<")

Back to Top


STRUPCASE

Category Data Manipulation Functions
Description Returns the upper case version of the string. Performs same function as UPCASE
Support Wozterm and Wozix
Syntax STRUPCASE ( str exp )
Usage STRUPCASE(string)
Parameters No parameter description available
Return Value STRING - Upper case string
Errors This keyword does not set the error flag.
Example
@comment(STRUPCASE("abcDEF"))   ! output = ABCDEF

Back to Top


@SUBROUTINE

Category Program Handling Functions
Description Defines a subroutine that can be invokes via a @GOSUB statement. Subroutines are similar to procedures however, they do not have any parameters and they do not have to be defined prior to a being invoked (via a @GOSUB statement). @RETURN can be used to force an early exit from a subroutine.
See also @GOSUB and @SUBROUTINEREF.
Note: Subroutine body must be enclosed between @BEGIN and @END.
Support Wozterm and Wozix
Syntax @SUBROUTINE subroutine_name
@BEGIN
...
@END
Usage @SUBROUTINE subroutine_name @BEGIN code @END
Parameters subroutine_name - The name to assigned to the subroutine consisting of up to 30 characters (a - z, A - Z, _, 0 - 9) starting with a letter or an underscore.
code - Instruction (or instructions) that does something, eg SET, COMMENT, DISPLAY, CONNECT etc.
Return Value None
Errors This keyword does not set the error flag.
Example
@GOSUB HelloWorld
@COMMENT("Continue with rest of the script file ....")
.....
.....
@STOP

@SUBROUTINE HelloWorld
@BEGIN
    @COMMENT("Hello World")
@END

Back to Top


@SUBROUTINEREF

Category Program Handling Functions
Description Define a reference to a subroutine which can be assigned to point to any subroutine. See also DEFAULTVALUE, @GOSUB and @SUBROUTINE.
Support Wozterm and Wozix
Syntax @SUBROUTINEREF subroutine_ref [ [ DEFAULTVALUE ] = subroutine_name ]
Usage @SUBROUTINEREF sub_ref_name [ [ DEFAULTVALUE ] = subroutine_name ]
Parameters subroutine_ref - The name to assigned to the subroutine reference consisting of up to 30 characters (a - z, A - Z, _, 0 - 9) starting with a letter or an underscore.
subroutine_name - The name of a defined subroutine that the subroutine reference is to point to.
Return Value None
Errors This keyword does not set the error flag.
Example
@SUBROUTINEREF num_type

@BOOLEAN got_even = FALSE
@INTEGER result, random_num
@WHILE NOT got_even DO
@BEGIN
    @SET random_num = RANDOM(10)
    @SET result = random_num % 2
    @IF result = 1 THEN
        @SET num_type = PrintIsOdd
    @ELSE
        @SET num_type = PrintIsEven
    @GOSUB num_type
@END

@SUBROUTINE PrintIsOdd
@BEGIN
    @COMMENT("The random number generated ",random_num," is odd.")
@END

@SUBROUTINE PrintIsEven
@BEGIN
    @COMMENT("The random number generated ",random_num," is even.")
    @SET got_even = TRUE
@END

Back to Top


@SYSPWORD

Category Communication Functions
Description Ozterm keyword used to set or clear the System 12 Password. This is the old Ozterm keyword used to set the System 12 password.
Please use @SETPASSWORD('S12', password_string).
Support This DOS Ozterm keyword has been deprecated - it is NOT supported.
Syntax N/A
Usage N/A
Parameters N/A
Return Value N/A
Errors This command will result in a compile error if used.
Example
N/A

Back to Top


TEXTEVSET

Category Event Handling Functions
Description Sets up a text event for this Wozterm session. Uses the value set by @PATTERNLEVEL to determine if pattern is case sensitive. This will run the transmit file, starting at 'label_name', when the printout 'pattern' is received. If the optional event log file name 'logfile_name' is specified, the event log will be opened to record all session responses. See full list of Event Handling Functions
Support Wozterm
Syntax TEXTEVSET ( label, str exp [, str exp] )
Usage TEXTEVSET(label_name, pattern [, logfile_name])
Parameters label_name - Label within the transmit file that the text event will run from.
pattern - String of text required to trigger the Text event and run this transmit file.
logfile_name (optional) - Event Log file to be opened when the Text Event occurs.
Return Value INTEGER
0 - when the Text event was set up OK.
1 - implies no room left in the Text Event Table.
2 - means an invalid parameter used, ie. label, pattern or log file.
Errors This keyword does not set the error flag.
Example
@label load
  @boolean result = EVLOADED(START)
  @if result then GOTO endset
  @integer resset = TEXTEVSET(START,">","AOM.log")
  @if resset = 0 then hide
  @else if resset = 1 then comment("No space left in Text Event Table for CALL_AOM.CMD")
  @else if resset = 2 then comment("Invalid parameter in TEXTEVSET command in CALL_AOM.CMD")
@label endset
@stop

@label START
  @comment('Run Text event')
  ! do stuff
  @delaysec(3)
  @close('AOM.log')
@stop

Back to Top


THEN

Category Program Handling Functions
Description Used with @IF and @IFERROR to perform conditional execution of script. Code segment following THEN will be executed if the conditional expression of an @IF is evaluates to TRUE or if the error flag is set in the case of @IFERROR.
Support Wozterm and Wozix
Syntax ( @IFERROR / @IF bln exp ) THEN
[ @BEGIN ]
...
[ @END ]
Usage ( @IFERROR / @IF condition ) THEN code
Parameters code - Instruction (or instructions with @BEGIN ... @END) that does something, eg SET, GOTO, GOSUB, etc.
Return Value None
Errors This keyword does not set the error flag.
Example
@INTEGER zero = 0
@INTEGER random_num = RANDOM(100)
@CHECK(OFF)
@IF random_num < 50 THEN
    @COMMENT("Random number generated less than 50")

@IF random_num > 60 THEN
@BEGIN
    @COMMENT("Random number generated greater than 60")
    @SET random_num = random_num / zero
@END

@IFERROR THEN
    @COMMENT("Attempted to divide by zero")

Back to Top


TIMEEVSET

Category Event Handling Functions
Description Sets up a time event for this Wozterm session. See full list of Event Handling Functions
Support Wozterm
Syntax TIMEEVSET ( label, str exp [, str exp [, str exp]] )
Usage TIMEEVSET(label_name, date_time, rescheduled_option, time_interval)
Parameters label_name - Label within the script file to start when the time event occurs.
date_time - Date/time string indicating when to start the time event.
rescheduled_option - Automatic or Manual where A will automatically reschedule the time event with out running it if the time to start had passed while this session was closed. M will ask the user if they want the time event to run immediately if the time to start had passed while the session was closed.
time_interval - Rescheduling time interval for setting the next run time for the time event. Can take the values 0 - 99 with W, D, H, or M, ie. 0 - 99 Weeks, Days, Hours or Minutes)
Return Value INTEGER
0 - time event set ok.
1 - too many events, implies no room left in the Time Event Table.
2 - bad parameter, invalid parameter (label or slogan) used.
Errors This keyword does not set the error flag.
Example
! Remove ALL events
@EVDELETE
@INTEGER result

! DOIT will be rescheduled once
@SET result = TIMEEVSET(DOIT, ADVANCE(GETDATETIME(),'1m'))
@if result = 1 THEN GOTO TOOMANYEVENTS

! DOIT will be scheduled to run automatically in a minute
@SET result = TIMEEVSET(DOIT, ADVANCE(GETDATETIME(),'1m'), 'A')
@if result = 1 THEN GOTO TOOMANYEVENTS

! DOIT will run automatically every minute
@SET result = TIMEEVSET(DOIT, ADVANCE(GETDATETIME(),'1m'), 'A', '1M')
@if result = 1 THEN GOTO TOOMANYEVENTS

! DOIT will run manually every minute
@SET result = TIMEEVSET(DOIT, ADVANCE(GETDATETIME(),'1m'), 'M', '1M')
@if result = 1 THEN GOTO TOOMANYEVENTS

! DOIT running on script first run
@GOTO ENDSCRIPT

@LABEL DOIT
  @COMMENT("TimeEvent.cmd triggered ", GETDATETIME())
@GOTO ENDSCRIPT

@LABEL TOOMANYEVENTS
  @COMMENT("You already have too many time events")

@LABEL ENDSCRIPT
.....

Back to Top


@TITLE

Category Program Handling Functions
Description Sets up a description for the current script.
Support This DOS Ozterm keyword has been deprecated - it is NOT supported.
Syntax N/A
Usage N/A
Parameters N/A
Return Value N/A
Errors This command will result in a compile error if used.
Example
N/A

Back to Top


TO

Category Program Handling Functions
Description Used in constructing an incrementing @FOR loop. With each iteration of the @FOR loop, the variable is to be incremented, from its initial value to the terminating value.
Support Wozterm and Wozix
Syntax @FOR [ INTEGER ] var = int exp TO int exp code
Usage @FOR [INTEGER] var_name = start_val TO end_val code
Parameters var_name - Name of the integer variable to used in controlling loop. If the variable has not previously defined, the keyword INTEGER must precede the variable name.
start_val - Numeric value assigned to the loop variable for the first iteration of the FOR loop.
end_val - Numeric value assigned to the loop variable for the last iteration of the FOR loop (provided @ENDLOOP is not used). Should be greater than 'start_val' for the loop to execute.
code - Instruction (or instructions with @BEGIN ... @END) that does something, eg SET, GOTO, GOSUB or even another @FOR loop.
Return Value None
Errors This keyword does not set the error flag.
Example
@FOR INTEGER count = 10 TO 0
    @COMMENT(count)

Back to Top


@TRACE

Category Program Handling Functions
Description Turns script tracing on/off with optional output to file if filename given.
Support Wozterm
Syntax @TRACE ( bln exp [, str exp] )
Usage @TRACE( ON / OFF [,filename])
Parameters No parameter description available
Return Value None
Errors This keyword does not set the error flag.
Example
@TRACE(ON)               !Script tracing activated
.....
.....
@TRACE(OFF)              !Script tracing deactivated

Back to Top


@TRAP

Category Program Handling Functions
Description Defines a subroutine that can be used to perform error trapping. Traps do not have to be defined prior to the point at which they are activated (via @CHECK) or invoked (via a runtime error occurring).
Support Wozterm and Wozix
Syntax @TRAP trap_name
@BEGIN
...
@END
Usage @TRAP trap_name BEGIN code END
Parameters trap_name - The name to assigned to the trap consisting of up to 30 characters (a - z, A - Z, _, 0 - 9) starting with a letter or an underscore.
code - Instruction (or instructions) that does something, eg SET, COMMENT, DISPLAY, CONNECT etc.
Return Value None
Errors This keyword does not set the error flag.
Example
@TRAP GotError
@BEGIN
    @INTEGER err_num
    @STRING err_desc
    @CALL GETERRORFLAG(err_num,err_desc)
    @SETERRORFLAG(OFF,0)
    @COMMENT("Error encountered (",err_num,") ",err_desc)
@END

@CHECK(OFF,GotError)
@INTEGER zero = 0
@SET zero = 1 / zero    ! This will cause a runtime error

Back to Top


TRIM

Category Data Manipulation Functions
Description Removes leading and trailing whitespace from a string. See also STRTRIM.
Support Wozterm and Wozix
Syntax TRIM ( str exp )
Usage TRIM(string)
Parameters string - The string variable to be trimmed of leading and trailing spaces.
Return Value STRING - Trimmed string
Errors This keyword does not set the error flag.
Example
@STRING x = " blah blah    "
@comment(">",x,"<")
@TRIM(x)
! x will now equal "blah blah"
@comment(">",x,"<")

Back to Top


TRUE

Category Reserved Words
Description Boolean true. Equivalent to OK and ON. See also OK and ON. Opposite of FALSE, FAIL and OFF.
Support Wozterm and Wozix
Syntax TRUE
Usage @CHECK(TRUE)
Parameters None
Return Value BOOLEAN - TRUE
Errors This keyword does not set the error flag.
Example
@CHECK(TRUE)

Back to Top


@UNHIDE

Category Screen / Input / Output Functions
Description Show the script file window. See also @HIDE, @HIDETERM, @UNHIDETERM, @HIDECMDHIST, @UNHIDECMDHIST
Support Wozterm
Syntax @UNHIDE
Usage @UNHIDE
Parameters None
Return Value None
Errors This keyword does not set the error flag.
Example
@HIDE
@comment('script window hidden')
@delaysec(3)
@UNHIDE
@comment('script window visible')
@delaysec(3)

Back to Top


@UNHIDECMDHIST

Category Screen / Input / Output Functions
Description Shows command history.
See also @HIDECMDHIST, @HIDE, @UNHIDE, @HIDETERM, @UNHIDETERM
Support Wozterm and Wozix
Syntax @UNHIDECMDHIST
Usage @UNHIDECMDHIST
Parameters None
Return Value None
Errors This keyword does not set the error flag.
Example
@INTEGER i
@HIDECMDHIST
@FOR i = 10 DOWNTO 1
@BEGIN
	@COMMENT("Command History will be hidden for ", i, " seconds")
	@delaysec(1)
@END
@UNHIDECMDHIST

Back to Top


@UNHIDETERM

Category Screen / Input / Output Functions
Description Shows terminal window.
See also @HIDETERM, @HIDE, @UNHIDE, @HIDECMDHIST, @UNHIDECMDHIST
Support Wozterm and Wozix
Syntax @UNHIDETERM
Usage @UNHIDETERM
Parameters None
Return Value None
Errors This keyword does not set the error flag.
Example
@UNHIDE
@UNHIDETERM
@COMMENT("The terminal window will disappear for 5 seconds")
@DELAYSEC(1)
@HIDETERM
@DELAYSEC(5)
@UNHIDETERM

Back to Top


UNTIL

Category Program Handling Functions
Description Defines terminating condition for @REPEAT loops. The @REPEAT loop continues until the condition is met.
Support Wozterm and Wozix
Syntax @REPEAT
[ @BEGIN ]
...
[ @END ]
@UNTIL bln exp
Usage @REPEAT code UNTIL condition
Parameters code - Instruction (or instructions with @BEGIN ... @END) that does something, eg SET, GOTO, GOSUB, etc.
condition - Statement which should evaluate to TRUE if the loop is to be exited. Loop will continue to be performed if it evaluates to FALSE.
Return Value None
Errors This keyword does not set the error flag.
Example
@INTEGER count = 0
@REPEAT
@BEGIN
    @COMMENT("count = ",count)
    @INC(count)
@END
@UNTIL count >= 10

Back to Top


UPCASE

Category Data Manipulation Functions
Description Returns the upper case version of the string. Performs same function as STRUPCASE
Support Wozterm and Wozix
Syntax UPCASE ( str exp )
Usage UPCASE(string)
Parameters No parameter description available
Return Value STRING - Upper case string
Errors This keyword does not set the error flag.
Example
@comment(UPCASE("abcDEF"))   ! output = ABCDEF

Back to Top


@UPPERCASEINPUT

Description Turns forcing of user input text to upper case on or off, default is ON. Used with @INPUT, @INKEY and @FORM.
Support Wozterm and Wozix
Syntax @UPPERCASEINPUT ( bln exp )
Usage @UPPERCASEINPUT( ON / OFF )
Parameters ON - Default, all user script input is automatically converted to upper case.
OFF - Retains the case of characters as typed by the user.
Return Value None
Errors This keyword does not set the error flag.
Example
@string Name = "My Name"
@string password = ""
@string genderText
@boolean male = false
@integer age
@string text = 'Free text'
@UPPERCASEINPUT(OFF)
@dialog(1,1,0,text,"Free text explaining the use of this dialog.",false,false,\
               1,2,12,Name,"Enter Name",false,TRUE,\
               1,3,12,password,"Enter Password",true,TRUE,\
               1,4,500,male,"Male",false,false,12,4,3,age,"Age",false,false)
@if male then
	@genderText = concat(" is a ", age, " year old man")
@else
	@genderText = concat(" is a ", age, " year old woman")
@Comment("Name: ", name, " Password: ", password, genderText)

@UPPERCASEINPUT(ON)
@dialog(1,1,0,text,"Free text explaining the use of this dialog.",false,false,\
               1,2,12,Name,"Enter Name",false,TRUE,\
               1,3,12,password,"Enter Password",true,TRUE,\
               1,4,500,male,"Male",false,false,12,4,3,age,"Age",false,false)
@if male then
	@genderText = concat(" is a ", age, " year old man")
@else
@genderText = concat(" is a ", age, " year old woman")
@Comment("Name: ", name, " Password: ", password, genderText)

Back to Top


@USELIBRARYFILE

Category Program Handling Functions
Description Compiles in contents of specified file at current position. See also @LIBRARY. This script command must be placed in the main script file before any subsequent calls to functions or procedures in the named library file.
Support Wozterm and Wozix
Syntax @USELIBRARYFILE ( str exp )
Usage @USELIBRARYFILE(script_filename)
Parameters script_filename - Script file name defined as the library file containing functions or procedures used by the main script file.
Return Value None
Errors This keyword does not set the error flag.
Example
See @LIBRARY example.

Back to Top


USERDIR

Description Returns the UserRoamingDirectory path of the application. This is where the application and session INI files are stored. See also @SESSIONDIR, @SAVEDIR, @SESSION, @MACHINEDIR, @MKDIR, @GETDIR, @CHDIR and @PROGRAMDIR. In OZI (Ozterm6 Interpreter) mode this keyword may be used as either a command or a function.
When used as a command (@USERDIR - OZI mode only)): The current session's settings directory is returned within the variable supplied as the parameter. When used as a function (USERDIR(): The current session's settings directory is the function's return value, the SEND string is the first parameter,
Support Wozterm and Wozix
Syntax USERDIR ( )
Usage @USERDIR() or
(OZI mode only) @USERDIR(path) or USERDIR
Parameters None
Return Value STRING - UserRoamingDirectory path
Errors This keyword does not set the error flag.
Example
@comment(USERDIR())

Back to Top


VAREXIST

Category Program Handling Functions
Description Checks if the specified {session} variable exists. For detailed description and examples of session variables and varexist see Session Variables
Support Wozterm and Wozix
Syntax VAREXIST ( str exp )
Usage VAREXIST(string)
Parameters No parameter description available
Return Value BOOLEAN - TRUE if variable exists.
Errors This keyword does not set the error flag.
Example
@IF not VAREXIST("autofile") THEN SET {"autofile"} = "NO"

Back to Top


VERSION

Category Program Handling Functions
Description Returns the version string of the application. See also @OVMVERSION
Support Wozterm and Wozix
Syntax VERSION ( )
Usage VERSION()
Parameters None
Return Value STRING - Program Version string
Errors This keyword does not set the error flag.
Example
@comment(VERSION())

Back to Top


@VIEWFILE

Category File / Disk Handling Functions
Description View the contents of a file in the default editor. See also @EDITFILE
Support Wozterm
Syntax @VIEWFILE ( str exp [, int exp] )
Usage @VIEWFILE(filename [, line_number])
Parameters filename - Name of the file to be opened for viewing.
line_number (optional) - Line number to go to in the opened file.
Return Value None
Errors This keyword does not set the error flag.
Example
No example script segment available

Back to Top


WAIT

Category Communication Functions
Description Used by @CNTRLD to wait 4 seconds after a quiet line after sending a ^D. See also @CNTRLD.
Support Wozterm and Wozix
Syntax @CNTLRD [(WAIT)]
Usage @CNTRLD [( WAIT )]
Parameters See @CNTRLD.
Return Value None
Errors This keyword does not set the error flag.
Example
@LABEL RELTES1
DIVAP:BNR=5, BAN=22, VLN=H0;
@IF SCAN("00FF") <> 0 THEN GOTO RELTES2
@DELAY(1)
@GOTO RELTES1
@LABEL RELTES2
@CNTRLD(WAIT)       ! Waits four seconds for a quiet line
@CALL WAITFOR(0,"START")

Back to Top


WAITFOR

Category Communication Functions
Description Waits for specified pattern(s) to arrive within timeout period specified. Uses the value set by @PATTERNLEVEL to determine if pattern is case sensitive. See also SENDWAITFOR and @SEND.
Support Wozterm and Wozix
Syntax WAITFOR ( int exp, int/str exp [, int/str exp [, int/str exp]] )
Usage @integer result = WAITFOR(timeout, pattern1 [, pattern2 [, pattern3]])
Parameters timeout - Time out value in seconds, 0 for no time out.
pattern1..3 - Pattern(s) to wait for. First pattern is required, second and third are optional.
Return Value INTEGER
0 - If timeout expires.
1 - If the first pattern is received.
2 - If the second pattern is received.
3 - If the third pattern is received.
Errors This keyword does not set the error flag.
Example
@HOSTCMD('stbsp:dety=all;')
@check(off)
@repeat
@begin
  @set result = WAITFOR(25,'END',' PAGE ')
  @if result = 1 then resp = 'good'
  @if result = 0 then resp = 'bad'
  @comment('Page header received')
@end
@until inset(result,0,1)

@comment('Finished ',resp,' ',REPLYLEN())

Back to Top


@WAITREPLY

Category Communication Functions
Description Wait indefinitely for pattern(s) set with @SETREPLY to be received. See also @SETREPLY.
Support Wozterm and Wozix
Syntax @SETREPLY(OK,pattern_1)
@SETREPLY(FAIL,pattern_2)
@WAITREPLY
@IFERROR then code
@else code
Usage @WAITREPLY
Parameters None
Return Value None
Errors Error flag set if SETREPLY(FAIL,pattern) data is received.
Example
INMCT:SPG=0;
INVOL:NODE=A,IO=OD-1;
END;
@SETREPLY(OK,"VOLUME LOADED")
@SETREPLY(FAIL,"FAULT CODE")
@if POS("AOM",getmode()) = 0 then CNTRLD
@WAITREPLY
@IFERROR then Comment('*Failed')
@else GOTO loadok
@comment("COULD NOT LOAD OD!")
@pause

@label loadok
.....

Back to Top


@WHILE

Category Program Handling Functions
Description Executes a loop while a condition is met.
The @NEXTLOOP command can be used to go on to the next iteration of the loop.
The @ENDLOOP command can be used to exit (terminate) a loop before the exit guard condition is met.
Support Wozterm and Wozix
Syntax @WHILE bln exp DO
[ @BEGIN ]
...
[ @END ]
Usage @WHILE condition DO code
Parameters condition - Statement which should evaluate to TRUE if the loop is to continue to be performed. Loop will be exited if it evaluates to FALSE.
code - Instruction (or instructions with @BEGIN ... @END) that does something, eg SET, GOTO, GOSUB, etc.
Return Value None
Errors This keyword does not set the error flag.
Example
@INTEGER count = 0

@WHILE count < 10 DO
@BEGIN
    @COMMENT("count = ",count)
    @INC(count)
@END

! ------------------ OR ------------------

@INTEGER year = INT(COPY(GETDATETIME(),1,4))
@INC(year)
@STRING new_years_day = CONCAT(STR(year),"0101000000001")
@WHILE GETDATETIME() < new_years_day DO
    @SLEEP(1)
@COMMENT("Happy New Year ",year,"!!")

Back to Top


@WINDEND

Category Screen / Input / Output Functions
Description Hides the window previously created with @WINDOW. See also @WINDOW.
Support Wozterm
Syntax @WINDEND
Usage @WINDOW code @WINDEND
Parameters None
Return Value None
Errors This keyword does not set the error flag.
Example
@WINDOW
@comment('Normal Window')
@prompt
@WINDEND
@comment('Close Window')

Back to Top


@WINDOW

Category Screen / Input / Output Functions
Description Displays a user window, optionally use entire application window. See also @WINDEND.
Support Wozterm
Syntax @WINDOW ( [bln exp] )
Usage @WINDOW [ ( ON / OFF ) ] code @WINDEND
Parameters ON (optional) - Displays @WINDOW window full screen in the session.
OFF (optional) - Default, displays @WINDOW window in the lower portion of the session screen.
Return Value None
Errors This keyword does not set the error flag.
Example
@WINDOW
@comment('Normal Window')
@prompt
@WINDOW(ON)
@comment('Full screen Window')
@prompt
@WINDOW(OFF)
@comment('Window OFF')
@prompt
@WINDEND
@comment('Close Window')

Back to Top


@WRITE

Category File / Disk Handling Functions
Description Opens specified file, appends supplied values as text, and closes file.
Support Wozterm and Wozix
Syntax @WRITE ( str exp [, exp...] )
Usage @WRITE(filename, expression [, ...])
Parameters filename - The name of the file to write to. If it exists, the data will be appended. If it doesn't exist, the file will be created and the data added to it.
expression - An expression that resolves to text which will be written to the specified file.
Return Value None
Errors This keyword does not set the error flag.
Example
@string data = getname()
@WRITE('Text.txt',strcopy(data,strpos("\",data,LAST),strlength(data)))

Back to Top


XOR

Category Program Handling Functions
Description Boolean exclusive OR operator returns TRUE if only one of the expressions is TRUE. The expression "a XOR b" is equivalent to "(a AND NOT b) OR (NOT a AND b)".
See also AND, NOT and OR.
Support Wozterm and Wozix
Syntax bln exp XOR bln exp
Usage exp1 XOR exp2
Parameters exp1, exp2 - Literal, variable or expression which evaluates to a boolean value (TRUE or FALSE).
Return Value BOOLEAN - TRUE if one (and only one) of the expressions evaluate to be TRUE, otherwise FALSE.
Errors This keyword does not set the error flag.
Example
@BOOLEAN t = TRUE
@BOOLEAN f = FALSE

@IF t XOR t THEN
    @COMMENT("ERROR")
@ELSE
    @COMMENT("(TRUE exclusive-OR TRUE) -> FALSE")
@IF t XOR f THEN
    @COMMENT("(TRUE exclusive-OR FALSE) -> TRUE")
@ELSE
    @COMMENT("ERROR")
@IF f XOR t THEN
    @COMMENT("(FALSE exclusive-OR TRUE) -> TRUE")
@ELSE
    @COMMENT("ERROR")
@IF f XOR f THEN
    @COMMENT("ERROR")
@ELSE
    @COMMENT("(FALSE exclusive-OR FALSE) -> FALSE")

Back to Top


Previous SectionIntroduction
Document HomeContents
Line TypesNext Section


This publication has been prepared and written by Telstra Corporation Limited (ACN 051 775 556), and is copyright. Other than for the purposes of and subject to the conditions prescribed under the Copyright Act, no part of it may in any form or by any means (electronic, mechanical, microcopying, photocopying, recording or otherwise) be reproduced, stored in a retrieval system or transmitted without prior written permission from the document controller. Product or company names are trademarks or registered trademarks of their respective holders.

Note for non-Telstra readers: The contents of this publication are subject to change without notice. All efforts have been made to ensure the accuracy of this publication. Notwithstanding, Telstra Corporation Limited does not assume responsibility for any errors nor for any consequences arising from any errors in this publication.