Skip to main content

ObjectScript Commands

This document provides detailed descriptions of the commands supported by ObjectScript. In this manual, ObjectScript commands are divided into two groups:

Within each group, the commands are presented in alphabetical order.

For more information on ObjectScript commands generally, see Commands.

You can abbreviate most commands to the first letter of the command name, or, in the case of commands that begin with the letter Z, to the first two letters of the command name. In the Synopsis for each command, the full name syntax is first presented, and below it is shown the abbreviated name (if one exists).

The Synopsis for each command contains only literal syntactical punctuation. The Synopsis does not include punctuation for format conventions, such as what elements of the syntax are optional. This information is provided in the table of arguments immediately following the Synopsis.

The one exception is the ellipsis (...). An ellipsis following a comma indicates that the argument (or argument group) preceding the comma can be repeated multiple times as a comma-separated list. An ellipsis within curly braces { . . . } indicates that a block of code containing one or more commands can be specified within the curly braces. The curly braces are literal characters that must be specified in the code.

Most commands take one or more arguments. Arguments are expressions (for example, a function and its arguments, a variable, an operator and its operands, an object property, or an object method) that define or control the action of the command. Multiple arguments used with a command are generally referred to as an argument list. Some commands have arguments that themselves take argument parameters. For example, each argument of the DO command can take a parameter list. This is indicated in the syntax.

Some commands are argumentless, and can be invoked without any arguments. Some commands never take arguments; other commands take arguments only in certain circumstances. Such commands change their meaning depending on whether they are argumentless, or specify an argument list.

Most commands can take an optional postconditional expression, which specifies a condition that dictates whether or not the command should be executed. A postconditional expression is appended to the command name by a colon (:). No spaces or line breaks are permitted between a command name and its postconditional expression. While a postconditional expression is not, strictly speaking, a command argument, they are here presented with the arguments. An argumentless command can take a postconditional expression.

Most ObjectScript commands are the same on all hardware platforms. Any platform-specific features of a command are marked with the type of platform that supports it; for example, Windows or UNIX®. Any command not marked with a platform limitation is supported by all platforms.

  • BREAK – Interrupts execution at a breakpoint. Enables or disables user interrupts.
  • CATCH – Identifies a block of code to execute when an exception occurs.
  • CLOSE – Closes a file or a device.
  • CONTINUE – Jumps to FOR, WHILE, or DO WHILE command and re-executes test and loop.
  • DO – Calls a routine.
  • DO WHILE – Executes code while a condition exists.
  • ELSE – Clause of block-oriented IF command.
  • ELSEIF – Clause of block-oriented IF command.
  • FOR – Executes a block of code repeatedly, testing at the beginning of each loop.
  • GOTO – Transfers control.
  • HALT – Terminates execution of the current process.
  • HANG – Suspends execution for a specified number of seconds.
  • IF – Evaluates a boolean expression, then selects which block of code to execute based on the truth value of the expression.
  • JOB – Runs a process in background.
  • KILL – Deletes variables.
  • LOCK – Enables a process to apply and release locks to control access to data resources.
  • MERGE – Merges global nodes or subtrees from source into destination.
  • NEW – Creates empty local variable environment.
  • OPEN – Acquires ownership of a device or file for input/output operations.
  • QUIT – Terminates execution of a loop structure or a routine.
  • READ – Accepts input and stores it in a variable.
  • RETURN – Terminates execution of a routine.
  • SET – Assigns a value to a variable.
  • TCOMMIT – Marks the successful completion of a transaction.
  • THROW – Explicitly throws an exception to the next exception handler.
  • TROLLBACK – Rolls back an unsuccessful transaction.
  • TRY – Identifies a block of code to monitor for errors during execution.
  • TSTART – Marks the beginning of a transaction.
  • USE – Establishes a device as the current device.
  • VIEW – Reads and writes database blocks and modifies data in memory.
  • WHILE – Executes code while a condition is true.
  • WRITE – Displays output to current device.
  • XECUTE – Executes the specified commands.
  • ZKILL – Deletes a node while preserving the node’s descendants.
  • ZNSPACE – Sets the current namespace.
  • ZTRAP – Forces an error with a specified error code.
  • ZWRITE – Displays variable names and their values and/or expression values.
  • ZZDUMP – Displays an expression in hexadecimal dump format.
  • ZZWRITE – Displays the values of variables or expressions.
FeedbackOpens in a new tab