How to Read a Command Syntax |
A command syntax is read from left to right, and the required parts of the command syntax form a main line. When a required part of a command can vary, brackets are drawn around the available choices and the main line of the command connects with the information in brackets. The optional portion of a command appears below the main line. The following is an example of a command syntax:
The required parts of the above command are the command keyword COMPUTE, the type of computation (AVG, COUNT, MAXIMUM, MINIMUM, STDEV, SUM, or VARIANCE), the data used for the computation, either a column (colname) or expression (expression), and the name of the table or view where the column or expression can be found. The argument varname is the optional part of the COMPUTE command. This option allows you to store the result of the computation in a global variable. A WHERE clause is also optional and allows you to limit rows of data for the command.
In general, an R:BASE command has the following format:
COMMAND KEYWORD argument KEYWORD argument ...
Keywords, which tell R:BASE what to do, are uppercase. R:BASE reserves some keywords for its use-do not use those keywords for column, table, view, variable, form, or report names. Keywords that are not listed as reserved words can be used for names in the database; however, you should avoid those keywords so each part of a command is distinctive. For a list of R:BASE reserved words, see the "Reserved Words" entry.
Arguments are the lowercase words you see in syntax diagrams, and they represent some specific information you enter in a command. For example, if you see tblname in a syntax diagram, enter the name of a specific table from your database.
The keyword and argument combinations can vary with each use of a command. For example, in the syntax diagram of the COMPUTE command, the keyword and argument combinations will vary depending on what will be calculated, the name of the expression or column, and the table or view where the expression or column is found.
An arrow in a command syntax indicates what portion of the command can be repeated. As shown in the example below, part of the UPDATE command can be repeated:
The portions of the UPDATE command that can be repeated are: colname = .varname, colname = value, colname = (expression), or colname = NULL. Each part of the command that is repeated must be separated with a comma, or the current delimiter character.
Commands and keywords that are four or more letters can be abbreviated to a minimum of three unique letters. For example, INT can be used for INTERSECT. R:BASE orders the commands alphabetically. If you enter END, the command ENDIF is used; R:BASE would not use ENDSW or ENDWHILE. The correct abbreviations for ENDIF, ENDSW, ENDWHILE, are ENDI, ENDS, and ENDW. See the section "Short Name" in a command entry for the shortest supported form of the command name.