The text read off it
[page 25]
Imperative Clauses
An imperative clause is a group of words that expresses a complete command. The clause may or may not include symbols. It always begins with a verb and may contain one or more operands of the verb, as appropriate. The operands may include data-names, procedure-names, condition-names, literals, figurative constants, and arithmetic expressions. Following are several examples of imperative clauses:
OPEN INPUT.MASTER.FILE
GET PAY.RECORD
ADD 1 TO COUNTER
MOVE ZEROS TO AMOUNT.FIELD
GO TO TAX.CALCULATION
SET NET.PAY = GROSS.PAY - (GROSS.PAY
- (EXEMPTIONS * 13)) * .18 - OTHER.DEDUCTIONS
Conditional Clauses
A conditional clause consists of a conditional expression introduced by the word IF and terminated by the word THEN. The conditional expression may be simple or compound. The word IF is an operator which informs the system that the conditional expression which follows must be tested for truth or falsity. The word THEN defines the limit of the conditional expression to be tested; it will always be followed by an imperative clause.
Following are several examples of conditional clauses:
IF OUT.OF.ZONE THEN
IF AMOUNT GT 200 THEN
IF MARRIED AND OVER.21 THEN
IF A = B OR A = C AND A GT D THEN
Sentences
A Commercial Translator sentence corresponds to a sentence in English—it expresses a complete and independent thought. It must contain at least one imperative clause and may contain, in addition, one conditional clause and one or more additional imperative clauses. It is terminated by a period, which must be followed by a blank to distinguish it from the “imbedded period” used in names and from the decimal point used in numeric literals. Imperative clauses within the same sentence must be separated by commas.
When a conditional clause is used in a sentence, it must begin the sentence, and it must be followed by one or more imperative clauses to be executed if the prescribed condition is met. If the programmer wishes to prescribe alternative action to be taken if the conditional expression proves false, he may specify it by writing next (without intervening punctuation) the word OTHERWISE, followed by one or more imperative clauses. If the conditional expression should prove false, and if the sentence does not contain the word OTHERWISE, the conditional sentence will cause no action and the system will proceed to the next sentence in the program.
The following examples show how Commercial Translator sentences may be constructed:
ADD 1 TO COUNTER.
GO TO TAX.CALCULATION.
STOP.
IF MARRIED THEN MOVE NAME TO MAILING.LIST.M,
ADD 1 TO COUNTER.
IF GROSS.PAY LT NET.PAY THEN GO TO ERROR.ROUTINE.
IF OUT.OF.ZONE THEN DO BILLING.ROUTINE.A OTHERWISE
DO BILLING.ROUTINE.B.
