3 Programming with Eloquence
NOTE: The character oriented development environment is not available on NT platform
Here is an explanation of the options associated with eloq and eloqcore:
Executing the eloq or eloqcore command by itself starts the Eloquence program and causes a blank screen to appear. At this point, you are in the Eloquence development environment. You may create, edit, or run applications. To exit Eloquence and return to the HP-UX environment, type QUIT and press RETURN.
Specifying a program name along with the eloq or eloqcore command (for example, eloq ABC) causes the program specified to be run in the Eloquence environment. Once the program has completed, control returns to the HP-UX environment.
eloqcore program name input file nameand you can "press" a softkey by entering a line such as
:KEY#4in the input data file.
The QQUIT command terminates Eloquence without giving such a warning.
QUIT and QQUIT do not check for "secondary" tasks.
All these commands except list and store (lower case) are executed from within Eloquence. The list and store commands are executed from the HP-UX prompt. To execute a command, type it on the terminal and press RETURN.
The development commands are:
RUN [file specifier [,line id] ]
The file specifier is a string expression containing the file name and, optionally, the volume specifier as described in page 195 . The optional line id specifies a starting line number. Program files (files with the extension .PROG) can be loaded and run in this way. For example, RUN "START" loads and runs a program named START.PROG. RUN "START",50 loads and runs the program named START.PROG beginning at line 50. For more details on file operations, refer to page 195 .
If the program to be run is already in memory, it is not necessary to specify the file specifier. In this case the following syntax is appropriate:
RUN [line id]
RUN clears all the variables in a pre-run initialization and then begins execution of the program lines. The optional line id references a line in the main program and specifies that execution is to begin at that line. Omitting the line id causes execution to begin with the first line in memory. For example, executing RUN 150 causes execution to begin with line 150.
A complete list of the pre-run default conditions can be found in page 383 .
If the optional line id is not specified, execution resumes with the next program line to be executed. No pre-run initialization occurs with CONTINUE.
AUTO [beginning line number [,incremental value ] ]
If neither parameter is specified, executing AUTO causes line numbering to begin with the last line number in memory plus 10 and is incremented by 10 as lines are stored. The optional beginning line number and the incremental value must be positive integers from 1 to 32767. For example, executing AUTO 5,5 causes numbering to begin with 5 and increment by 5.
Automatic line numbering remains in effect until DELETE LINE is pressed or a program line is executed.
If no parameters are specified, all lines in memory are numbered in intervals of 10, beginning with 10. For example, REN 100,5 causes program lines to be renumbered in intervals of 5, beginning with line 100 (resulting in 100, 105, 110, and so on). All line references in the program are automatically adjusted as the lines are renumbered.
DEL first line id [,last line id]
NOTE: DEL is allowed as a program statement; however, references to line labels must be local to the current environment (main program or subprogram).
Specifying one line identifier causes only that line to be deleted. Specifying two line identifiers causes that block of lines to be deleted. For example, to delete line 40 and lines 100 through 150 from a program, execute DEL 40 and DEL 100,150.
The DEL SUB statement is available for deleting subprograms, as described in page 177 .
A program statement also can be deleted by re-entering only the program line number.
FETCH [line id]
When a line id is not specified, the current line is displayed. If the specified line does not exist, the next-highest numbered line in memory is displayed. If there are no lines beyond the specified line, the highest numbered line in memory is displayed. For example, to fetch line number 300, execute FETCH 300.
To fetch the highest line in memory, execute FETCH 32767.
If no program line is active and no line id is specified, the first line is displayed.
FETCH, like LIST, outputs as default to the system printer, unless system printer 8 (display) has been specified.
This makes it more convenient, to dynamically load subprograms or functions below the end of the program.
LOAD SUB "SUBX",LASTLINE+1,1
Both commands can produce a listing of a program; however the following tasks can only be done by one of the commands:
From Within the Eloquence Environment
The LIST command (upper case) is used to obtain a listing of the program or a section of the program currently in memory. The listing is output on the device specified as the system printer (the display is set to be the system printer when Eloquence is started). Syntax for the LIST command is as follows:
If no parameters are specified, the entire program in memory is listed. If one line identifier is specified, the program is listed from that line to the end. If two line identifiers are specified, that segment of the program, including beginning and ending lines, is listed. If a string is specified, the program lines containing that string are listed.
LISTLists the entire program.
LIST 50Lists the program beginning with line 50.
LIST 200,250Lists lines 200 through 250.
LIST "ABC"Lists all lines containing the string ABC.
LIST "ABC";50Lists all lines beginning with line 50 that contain the string ABC.
LIST "ABC";200,250Lists all lines from 200 through 250 that contain the string ABC.
LIST 50;20Lists the 20 lines starting at line 50.
To output LIST to a device other than the display, first specify the device via the SYSTEM PRINTER IS statement. Syntax for this statement is as follows:
All successive system printer output is now directed to the device specified rather than the display (printer number 8). Execute LIST to output a listing of the program. For example:
SYSTEM PRINTER IS 0 LISTTo redefine the display as the system printer, execute SYSTEM PRINTER IS 8. Executing SCRATCH ALL also returns output to the display, as does exiting and reentering Eloquence or the HP-UX operating system. See page 249 for more details on SYSTEM PRINTER IS and other printer options.
Within the HP-UX Environment
The list command (lower case letters) is used to obtain a listing of a program, to cross-reference check a program, or to convert a program file (.PROG) to an ASCII text file. The "list" command is executed from the HP-UX prompt. Syntax for the command is as follows:
The following options are available:
For example, the following "list" command converts the Eloquence program file ABC.PROG to an ASCII text file named abc.txt:
list ABC >abc.txtAt this point, the ASCII text file abc.txt can be edited using the vi editor. Once editing is completed, abc.txt is converted back to an Eloquence program file using the "store" command:
store -o ABC abc.txt
Here is an explanation of the available options:
store: "file.in", line 1: IMPROPER STATEMENT ^ ^ ^ ^ | | | The error message | | The line number of the input file | The name of the input file or stdin if read from stdin To indicate it's a message from the store utilityFor example:
Put the invalid statement below in a file named "file.in":
STOP HEREWithout the -e commandline argument, store will output the following error message:
STOP HERE ^ IMPROPER STATEMENT store: "file.in", line 37With the -e commandline argument, store will output the following error message:
store: "file.in", line 1: IMPROPER STATEMENTTo explain the store command, suppose you create an ASCII text file using the vi editor, and it contains the sample program shown in this chapter under page 44 . Also suppose the name of the ASCII text file is games.txt. The next step is to check the syntax of the ASCII text file and convert it to an Eloquence program file. This is done by issuing the following command:
store games.txtNotice that no output file is specified; therefore, the input file name (games) is used to create the Eloquence program file (games.PROG). This program file is now ready to be run.
NOTE: If a variable contains the linefeed character, the store command cannot proceed.
The following "store" command also could be used:
store -o GAMES games.txtThe resulting Eloquence program file is GAMES.PROG. Notice that the .PROG extension is automatically added. If GAMES.PROG had been specified as the output file, the result would have been GAMES.PROG.PROG, so do not include the .PROG extension when specifying an output file.
This will define a different tab character handling.
Sets the tab expansion to 8 for subsequent source lines.
Defines a different automatically generated line numbers.
Presets the next automatically generated line number to 1000 and the line increment to 10.
Presets the next automatically generated line number to 1000 and the line increment to 10.
! This is a sample program Eloquence program using the ! C preprocessor #define MAXLOOP 10 SUB Sample(INTEGER Partno) ! include the common block #include "common" ! The subprogram body DBASE IS Db$ IN DATA SET "PARTS" USE REMOTE LISTS Part_1 DBGET(Db$,"PARTS",7,S(*),"@",Buf$,Partno) ... FOR I=1 TO MAXLOOP ... NEXT I ... ! include the definitions for PARTS #include "PARTS" SUBENDTo make this a Eloquence PROG file, you could use the following command line:
cc -E sample | store -o SAMPLE -The C preprocessor replaces the #include directives by the referenced file content and the macros by the definitions. When a syntax error in an included file is detected, store is able to understand the preprocessor location information and will report the file name and position.
Please refer to the appropriate HP-UX documentation for more information.
RUN "GAMES" ENTER I'm thinking of a number between 0 and 9 You have three guesses Enter guess number, 1 Now, 5 Too low Enter guess number, 2 Now, 8 Too high Enter Guess number, 3 Now, 7 Sorry, the number was: 6. Game Score You Me 0 1 Do you want to play again? (YES/NO)This program will run until you enter "NO" (in capitals, with or without quotes) to the INPUT prompt Do you want to play again (YES/NO). You may halt the program at any other time by pressing BREAK or CTRL Y. When a program is halted, the line to have been executed next is displayed.
After halting a program, you can restart it from the line displayed by using the CONT (continue) command or restart from the beginning by using RUN.
The END statement halts program execution, like STOP, but is intended to be the last line in the main program. Any lines beyond END can still be executed (via branching or subroutines). END cannot be executed from the keyboard.
The PAUSE statement suspends execution, but does not reset program or file pointers. This allows you to do such things as check program variables and modify lines. Execution resumes by executing the CONT (continue) command. PAUSE cannot be executed from the keyboard.
Here is a typical use for STOP and END:
120 INPUT "Enter your Sales file access code,";Salescode 130 IF Salescode < 1000 THEN Access_error 140 ! User code invalid for all Sales file access 150 IF Salescode <> 9999 THEN Unauth_error 160 ! User code invalid for file update, read only allowed 170 ! Pass above tests then OK to update Sales file 180 Sales_update! Start of Sales file update program . . . 560 Access_error:! 570 DISP "Sorry, you are not allowed to enter the Sales file" 580 STOP 590 Unauth_error:! 600 DISP "Sorry, You can't enter the Sales file update program" 610 DISP "You have read access only" 620 STOP 630 Endit:! 640 ENDNote the use of STOP when there are multiple error conditions. Each error thus can display the correct reason for denying access, and the program will halt. No other error condition will be executed unnecessarily. Also note the use of the line label Endit, so the last line can be accessed without executing any error routines. STOP, of course, can be used anywhere within a program.
The WAIT statement delays program execution a specified number of milliseconds before continuing. The syntax is as follows:
WAIT [numeric expression]
The numeric expression can range from -231 through 231-1 (about 33 seconds); a negative number defaults to 0. The wait can be interrupted by pressing CTRL Y, in the character oriented runtime environment or a user-defined softkey. Examples are given later in this chapter and also in page 151 . More information on SLEEP is available in chapter 13.
3*(5/7 RETURNThis example causes the message IMPROPER EXPRESSION to appear on the following line and the cursor to flash below the omitted closing parenthesis. If you had entered both parentheses correctly, but typed the minus operator "-" instead of the division sign "/", no error message would be displayed.
If you are using the store command and an error occurs during the syntax check, no program (.PROG) file is created.
190 INPUT "Please Enter Number of Employees;",Emp_quantity 200 Emp_bonus = Total_bonus/Emp_quantity 210 PRINT Emp_bonusIf the operator enters an Emp_quantity of 0, the terminal will display ERROR 31 IN LINE 200. Error 31 indicates attempted division by 0. Note that this error can only be detected at run time, as a division by zero will only occur if an Emp_quantity of 0 is entered.
The line number displayed by a run-time error need not be the incorrect line. It merely shows the point at which the error was detected. These run-time errors can be handled (or "trapped") by the program by using the ON ERROR statement, as described in page 151 .
Internal error processing line 4420 Assertion failed: (ssp->ofs < seg->symsz) file prerun.c, line 227
STORE "file name"
For example, to create a program file named GAME and store the guessing game program in it, type in and execute the following:
STORE "GAME"This statement assumes that there is no other file on the disk already named GAME. Later, you may wish to store another version of the program in the same file by using the RE-STORE statement.
To see what files are now on the disk, execute the CAT (catalog) statement:
CAT total 4 -rw-rw-rw- 1 john tstctr 1070 Oct 12 10:59 GAME.PROGThe CAT listing shows you that GAME is a program file (.PROG) and requires 1070 bytes of disk space. The program was saved on October 12th at 10:59 (24 hour clock). The program belongs to the group tstctr and to the user john. The user, group, and others have read and write access to the program.
Later, use the LOAD statement to copy a previously-stored program back into the computer memory.
For more details on CAT, STORE, RE-STORE and the other storage operations, refer to page 195 .
NOTE: There is a difference between the STORE statement (upper case) and the store command (lower case). The STORE statement is executed from the Eloquence prompt or from within a program, while the store command is executed from the HP-UX prompt. Refer to page 29 and page 32 for more information on the store command.
NOTE: The STORE statement, like the store command, is only available in the development version of Eloquence (not the run-time version).
To get a printed listing, first specify the printer's address by using the SYSTEM PRINTER IS statement. (The system printer is usually set to address 8.) Then execute LIST again. For more information on printers, see page 249 .
For example, to obtain a printed listing of the guessing game example, the program should be retrieved from the disk, the system printer set to 0, and the LIST command executed as follows:
LOAD "GAME" SYSTEM PRINTER IS 0 LISTNOTE: The command to obtain a printed listing of the guessing game example from the HP-UX prompt is as follows:
list GAME | lpNOTE: This command produces a listing and pipes it to the lp command. Refer to the HP-UX documentation for more information on piping and the lp command.
INDENT starting column, increment
All program lines are re-positioned with the first character of each keyword starting in the specified column. Keywords are not placed in that column when numbers or labels already occupy the column. Comment (!) lines are not moved. Comments following statements are not moved unless they would overlap the statement.
Structured constructs (IFTHENELSE, REPEAT, SELECT, LOOP, WHILE) are indented an additional incremental value. Intermediate keywords in a construct (CASE, CASE ELSE, etc.) are not indented. If structured constructs do not match properly, either the indentation does not occur at the starting column at the end of the program segment or the listing returns to the starting column too soon. In either case the indentation is reset to the starting column at the beginning of each program segment (main program, multiple line function, subprogram, etc.).
The INDENT command also re-positions the FOR/NEXT, DEFFN/FNEND, and SUB/SUBEND system keyword pairs and certain Report Writer constructs. A sample program indented using INDENT 10,2 is shown on the next page.
NOTE: The maximum line length is 512 characters.
Listed below is the structure of a program before executing INDENT:
10 ! 20 ! INDENT does not change the position of comment lines. 30 ! 40 INPUT " Enter a number:";X 50 IF X>10 THEN 60 PRINT "X>10." 70 ELSE 80 PRINT "X<=10"; 90 IF X>0 THEN 100 PRINT ", but>0." 110 END IF 120 FOR I=1 TO X 130 Sum=Sum+X ! Trailing comments are not 140 NEXT I ! moved unless they get in 150 DISP "Sum from 1 - ";VAL$(X);" is";Sum ! the way. 160 END IF 170 CALL Y 180 END 190 SUB Y 200 DISP "(ALMOST DONE)" 210 LOOP 220 READ A$ 230 EXIT IF A$=" " 240 DISP A$ 250 WAIT 1000 260 END LOOP 270 DATA 5 seconds,4 seconds,3 seconds,2 second,1 second,DONE," " 280 SUBENDListed below is the structure of the previous program after executing INDENT 10,2:
10 ! 20 ! INDENT does not change the position of comment lines. 30 ! 40 INPUT " Enter a number:";X 50 IF X>10 THEN 60 PRINT "X>10." 70 ELSE 80 PRINT "X<=10"; 90 IF X>0 THEN 100 PRINT ", but>0." 110 END IF 120 FOR I=1 TO X 130 Sum=Sum+X ! Trailing comments are not 140 NEXT I ! moved unless they get 150 DISP "Sum from 1 - ";VAL$(X);" is";Sum ! in the way. 160 END IF 170 CALL Y 180 END 190 SUB Y 200 DISP "(ALMOST DONE)" 210 LOOP 220 READ A$ 230 EXIT IF A$=" " 240 DISP A$ 250 WAIT 1000 260 END LOOP 270 DATA 5 seconds,4 seconds,3 seconds,2 second,1 second,DONE," " 280 SUBEND
Other interruptions are made when an error is encountered, the end of a file is reached, or a softkey (SFK) is pressed. These interruptions can be handled using the appropriate ON statement. (In other words, you may define action to be taken when CTRL Y is pressed using the ON HALT statement.) ON interrupts may be disabled using the OFF statement. Executing SCRATCH ALL or starting Eloquence again also disables ON interrupts.
Another way to enter the single-step mode is to execute a GOTO statement from the keyboard. From this point, continue (as mentioned in the above paragraph) by pressing the BREAK key to execute each program line.
HOP [line id]
HOP will resume execution until reaching either the next line if line id is not specified or the line specified. Execution will stop before executing line.
This is an advantage in the debugging process, because functions, subprograms and loops may be executed, and execution stops after processing.
10 FOR I=1 TO 10 20 X=X+I 30 NEXT I 40 DISP X 50 ENDHOP 30 will resume execution until reaching line 30. Line 30 will be displayed. If you enter HOP execution will continue until line 40 is to be executed.
The TRACE Statement
The TRACE statement is used to trace program logic flow in all or part of a program. When any branching occurs in a program, both the line number where the branch is from and the line number where the branch is to are output. Syntax for this statement is as follows:
TRACE [beginning line id [,ending line id] ]
When a branch occurs, the output is in the following format:
TRACE--FROM line number TO line number
If no line ids are specified, all branches in the program are monitored. When one line id is specified, tracing does not begin until that line is executed. If a second line id is specified, tracing is switched off when that line is executed. Since TRACE operates dynamically, tracing may be switched on and off many times throughout the execution of a program. The beginning line id must be present in memory or tracing will never occur; the ending line id turns off the TRACE only if that line number is encountered.
The TRACE WAIT Statement
Use the TRACE WAIT statement in conjunction with any other TRACE statement to cause a specified delay after each statement that causes a trace output. It is used to monitor and examine trace output as it occurs. Syntax for this statement is as follows:
TRACE WAIT number of milliseconds
The delay is specified by a numeric expression in the range -32768 through 32767, which indicates the number of milliseconds after each trace printout. A negative number defaults to 0.
The TRACE PAUSE Statement
To check whether or not a line in a program is reached, or to monitor the number of times a specified line is executed, use the TRACE PAUSE statement. Syntax for this statement is as follows:
TRACE PAUSE line id [,numeric expression]
When only the line id is specified, the running program stops just before the specified line is executed. When the numeric expression is specified, it is rounded to an integer--call it N. The program will then stop when the specified line is reached for the Nth time; the line is not executed. Execution is resumed with that line by executing the CONT[INUE] command. Every subsequent execution of that line causes execution to pause. This type of tracing can be disabled by letting the line id be one that is not in memory. The most efficient way is to let it be lower than the lowest-numbered line. Also see page 282 , later in this chapter.
The TRACE VARIABLES Statement
To trace changes in values of variables without using an output statement, use the TRACE VARIABLES statement. Syntax for this statement is as follows:
TRACE VARIABLES variable list
The variable list can contain simple numerics, strings, and array specifiers. There can be from one to five items separated by commas. The value of any variable which changes is printed. The output is in the following format:
TRACE--LINE line number variable name [(subscripts)] = value
The line number is the line in which the change occurred. If the change comes from a keyboard operation, the line number is replaced by KEYBOARD. The new value of the variable is indicated. In the case of an array, the values of the subscript at the time will be printed following the name.
When an entire array changes value, the printout is in the following format:
TRACE--LINE lne number array name (*) CHANGED VALUE
Tracing variables also detects changes in subprograms or variables passed by reference. For example, say TRACE VARIABLES A,B is executed and the value of A is passed by reference to a subprogram. If the corresponding variable in the subprogram is changed, a trace message for variable A occurs.
The TRACE ALL VARIABLES Statement
To trace all variables, use the TRACE ALL VARIABLES statement. Syntax for this statement is as follows:
TRACE ALL VARIABLES [beginning line id [,ending line id] ]
When no line ids are specified, all variables are traced throughout the program. When one line id is specified, tracing begins after that line is executed. The ending line causes tracing to stop after that line is executed. TRACE ALL VARIABLES cancels and is cancelled by TRACE VARIABLES.
This method of tracing can be turned off by letting the first line id be one not in memory, such as an undefined label or line number lower than the lowest line number in memory. Also see page 282 , later in this chapter.
The TRACE ALL Statement
Use the TRACE ALL statement to trace all program logic and variables. This statement is equivalent to executing both TRACE and TRACE ALL VARIABLES.
Although the volume of printout is high, TRACE ALL is useful if a logic problem in a program has not been isolated with selective tracing.
The NORMAL Statement
All tracing modes are cancelled by either executing any SCRATCH statement or by using the NORMAL statement:
eloq -t [race] [level] [program name] [2>trace file]
If no program name is specified, the trace is performed on every program run. If a program name is specified, the trace will occur on only that program.
Three options are available for the level parameter--0 (default), 1, and 2.
Level 0 monitors all executed lines.
Level 1 monitors explicit assignments (for example, A=B*5).
Level 2 monitors implicit assignments like dbget and unpack.
The optional 2>trace file parameter is used to put the output of the trace into a file or display the output on another terminal. If 2>trace file is not specified, the trace output is displayed on the terminal, prior to the program output.
To send trace output to a file, replace trace file with the desired file name. You can then send this file to the printer or display it on the terminal. Here is an example:
eloq -t ABC 2>abctraceThis command (1) executes the program ABC, (2) performs a trace, (3) routes the trace output to the file abctrace, and (4) displays the program output on the terminal.
To display trace output on another terminal, replace trace file with the terminal address. Here is an example:
eloq -t ABC 2>/dev/tty1p5This command (1) executes the program ABC, (2) performs a trace, (3) displays trace output on terminal tty1p5, and (4) displays the program output on the terminal that the command was executed from.
To turn on External tracing within a program, use
XTRACE [tracing level] ...... ......Setting external trace level is identical to the -t option when starting Eloquence. The trace will be directed to stderr in both cases.
NOTE: External tracing is available in either the development or run-time mode of Eloquence. Note that XTRACE or XTRACE -1 will disable external tracing. XTRACE 2 will have the same effect as eloqcore -t2 command.
list -x [options]
Options associated with -x are l (labels and line numbers), c (constants), v (variables), and s (subprograms and functions). If no options are specified with -x, all of the options (l, c, v, and s) are set. In other words, the default is that a cross-reference be performed on all line labels, line numbers, constants, variables, subprograms, and functions.
Here is a short program named ADVERT. Following the program is the complete cross-reference table obtained by executing list -x ADVERT.
10 OPTION BASE 1 20 INTEGER Not_used ! Variable declared, but not used 30 DIM Sign$(7) ! Constants used in declaratives 40 Sign$(1)=" " 50 Sign$(2)=" " 60 Sign$(3)=" " 70 Sign$(4)=" " 80 Sign$(5)=" " 90 Sign$(6)=" " 100 Sign$(7)=" " 110 DISP " ",LIN(10) 120 Put_up_sign: ! Label not referenced 130 FOR Line=1 TO 7 ! Line not declared 140 DISP SPA(30);Sign$(Line) 150 NEXT Line 160 RESTORE 170 Again: ! 180 READ Message$ ! Message$ not declared 190 CURSOR (31,13) 200 DISP " "&Message$&" " 210 WAIT 900 220 IF Message$[1,1]="D" THEN 240 230 GOTO Again 240 Last_sign: ! Another unreferenced label 250 WAIT 2000 260 CURSOR (29,13) 270 DISP " "&"Buy Wonder-Shave Cream"&" " 280 END 290 ! 300 DATA " Dina "," doesn't ", " treat him "," right ..." 310 DATA " but if "," he'd shave ","Dina might!"The cross reference listing is as follows:
segment: main Symbol Type References --------------- ----- ------------------------------------------------- 1 CONST 220 220 40 130 10 CONST 110 13 CONST 190 260 2 CONST 50 2000 CONST 250 29 CONST 260 3 CONST 60 30 CONST 140 31 CONST 190 4 CONST 70 5 CONST 80 6 CONST 90 7 CONST 100 130 900 CONST 210 240 LINE 220 Again LABEL 170 230 Last_sign LABEL 240 Put_up_sign LABEL 120 Message$ X 200 180 220 Sign$ X(1) 60 100 50 40 30 80 70 90 140 Line R 140 150 130 Not_used I 20Integer numbers are listed first in the cross reference listing. These include numeric constants in declaratives, functions, etc. and referenced line numbers. The right-hand column lists all Eloquence links where each constant or line-number reference appears.
Next, all names are listed. The second column identifies each name type. Possible name types are listed in the table below.
|LABEL||Line Labels||R||Real Precision Variable|
|SUBP||Subprogram Labels||S||Short Precision Variable|
|N FUN||Numeric Functions||I||Integer Precision Variable|
|$FUN||String Functions||X||String Variable|
|LINE||Line Numbers||D||Double Integer Precision Variable|
A number in parentheses following variable types R, S, I or X indicates the array's number of dimensions. The right-hand column lists all line numbers where each label appears.
Here is a summary of the SCRATCH statements:
The Reset Table in page 384 lists all conditions reset by SCRATCH statements.