SoftSpy macro listing: Difference between revisions
Line 13: | Line 13: | ||
</tr> | </tr> | ||
<tr > | <tr > | ||
<td>BOT</td> | <td>[[#BOT macro|BOT]]</td> | ||
<td>Abbreviation for the | <td>Abbreviation for the BOTTOM macro. </td> | ||
</tr> | </tr> | ||
<tr > | <tr > |
Revision as of 20:20, 24 April 2014
Introduction
Macros are collections of SoftSpy commands. SoftSpy is shipped with the macros shown in the table below. Each macro is accompanied by a brief functional description. A complete listing of the macros is included on this page.
These macros can be tailored to meet the specific needs of your installation. In addition, you or others at your installation may write additional macros to meet your own personal needs or the needs of your installation. You can obtain a list of all macros available at your installation by entering the command LIST MACRO from a SoftSpy command line prompt, or SPY LIST MACRO from a Model 204 command line prompt.
Many of the macros act as commands, and are described in the command section of this manual. These include the BOTTOM, BREAKS, COVERAGE, DEBUG, ERROR, GLOBALS, QA, SCROLL, STATS, TOP, TRACER, and TUNE macros. Other macros support the program function key capabilities provided in the different SoftSpy environments. Still other macros act as abbreviations for commands with longer names.
Macro | Description |
---|---|
AUDIT | Establishes the interactive audit environment. |
BOT | Abbreviation for the BOTTOM macro. |
BOTTOM | Scrolls to end of data in the active window. |
BREAKS | Sets break points after request lines that contain *BREAK. |
CLOSE_WATCH_WINDOWS | Closes all watch windows. |
COVERAGE | Displays test coverage information about the current User Language request. |
D | Abbreviation for the DISPLAY command. |
DEBUG | Establishes the interactive debugging environment. |
DISPLAY_WATCH | Displays or watches operands on the command line, cursor line, or current line. |
ERROR | Issues an error message. |
GLOBALS | Watches all defined global variables. |
HELP_HELP | Provides hypertext links within the SoftSpy help facility. |
HELP_QUIT | Quits all nested help levels at once. |
ON_COMPILE_ERROR | Executes commands when a compile error occurs. |
ON_END_EVAL_QA | End of evaluation processing for the QA environment. |
ON_END_EVAL_TUNE | End of evaluation processing for the TUNE environment. |
ON_EVAL | Skips interactive execution of named subsystems. |
ON_EVAL_ERROR | Evaluation time error handling. |
ON_EVAL_TUNE | Start of evaluation processing for the TUNE environment. |
PFKEY_GO | Optionally runs GO UNTIL with contents of command line. |
PROFILE | Initializes SoftSpy defaults and function key assignments. |
QA | Establishes the interactive Quality Assurance environment. |
QQUIT | Quits the current activity without confirmation. |
QUAD | Make the statement at the specified quad offset the current statement. |
SCROLL | Scrolls based on user-specified criteria. |
SCROLL_SET | Used by the SCROLL macro to set scroll criteria. |
STATS | Watches all statistics and usage operands. |
TOGGLE_BREAK | Toggles a breakpoint on the current or cursor line. |
TOP | Scrolls to beginning of data in the active window. |
TRACER | Produces an execution trace during the evaluation of a request which is sent to the open printer. |
TUNE | Establishes the interactive performance tuning environment. |
UNREACH | Finds the next unreachable statement in the QA environment |
UNTESTED | Finds the next untested statement in the QA environment. |
WARNING | Issues a warning message. |
AUDIT macro
************************************************************* * SOFTSPY AUDIT MACRO: * * * * INITIALIZE OR REINITIALIZE THE SOFTSPY AUDIT ENVIRONMENT. * ************************************************************* * IF $CONTEXT EQ 'EVAL' THEN JUMP TO CONTOK TRANSFER ERROR 'CONTEXT MUST BE EVAL' CONTOK: IF C.QTBL IS KNOWN THEN JUMP TO AUDIT TRANSFER ERROR 'AUDIT OPTION NOT AVAILABLE' AUDIT: PF1 (EVAL) = HELP PF2 (EVAL) 'WINDOW' = ACTIVE WINDOW PF3 (EVAL) = QUIT PF4 (EVAL) 'STEP' = COMMAND 'STEP ' WITH $COMMAND PF5 (EVAL) 'GO' = EXEC PFKEY_GO PF6 (EVAL) 'BREAK' = EXEC TOGGLE_BREAK PF7 (EVAL) 'BACKWARD' = COMMAND 'BACKWARD ' WITH $COMMAND PF8 (EVAL) 'FORWARD' = COMMAND 'FORWARD ' WITH $COMMAND PF9 (EVAL) = REPEAT PF10(EVAL) 'WATCH' = EXEC DISPLAY_WATCH WATCH PF11(EVAL) 'QUAD' = COMMAND 'QUAD ' WITH $COMMAND PF12(EVAL) = RETRIEVE DEFAULT LINE NEXT UNWATCH * UNSHOW * UNCOLLECT * SHOW BRACKET NEST LEN 8, C.QTBL ON EVAL EXEC ON_EVAL ON END_EVAL IF $END_EVAL_DEBUG_GO THEN GO IF $DEFAULT_WATCH_WINDOW NE '' THEN JUMP TO WATCH DEFINE WINDOW MONITOR ROW 1 TO 12 COLUMN 51 TO 77 OPEN WINDOW MONITOR WATCH: SET $SPY_MESSAGE = '' ON CANCEL EXEC ON_EVAL_ERROR ON NON_CANCEL EXEC ON_EVAL_ERROR * ************************************** * RUN ANY USER SPECIFIC AUDIT MACRO * ************************************** * USER: DEFINE $MACRO_NAME STRING LEN 16 LOCAL SET $MACRO_NAME = $USERID WITH '_AUDIT' IF $MACRO_EXISTS($MACRO_NAME) THEN COMMAND $MACRO_NAME
BOT macro
*********************************************** * SOFTSPY BOT MACRO: * * * * SCROLL TO THE BOTTOM OF THE ACTIVE WINDOW. * *********************************************** * BOTTOM
BOTTOM macro
********************************************** * SOFTSPY BOTTOM MACRO: * * * * SCROLL TO THE BOTTOM OF THE ACTIVE WINDOW. * ********************************************** * FORWARD 99999
BREAKS macro
************************************************************* * SOFTSPY BREAKS MACRO: * * * * THIS MACRO IS EXECUTED TO SET A BREAK POINT ON THE FIRST * * EXECUTABLE LINE FOLLOWING EACH LINE IN THE SOURCE PROGRAM * * THAT CONTAINS *BREAK. THE SEARCH FOR LINES ON WHICH TO * * SET BREAK POINTS BEGINS JUST AFTER THE CURRENT LINE. * ************************************************************* * DEFINE $SOURCE_LINE IS FIXED LOCAL IF $CONTEXT NE 'EVAL' THEN JUMP TO NOEVAL SET $SPY_MESSAGE = '' IN SOURCE /*BREAK IF $SPY_MESSAGE NE '' THEN JUMP TO NONE BREAK: SET $SOURCE_LINE = $CURRENT_LINE('SOURCE') LOOP: IF $SOURCE_LINE IS NUM GE $MAX_LINE('SOURCE') THEN JUMP TO END SET $SOURCE_LINE = $SOURCE_LINE + 1 IF $SOURCE_LINE_INFO('TYPE',$SOURCE_LINE) NE 'X' THEN JUMP TO LOOP SET $CURRENT_LINE('SOURCE') = $SOURCE_LINE BREAK IF $SPY_MESSAGE NE '' THEN RETURN IN SOURCE /*BREAK IF $SPY_MESSAGE EQ '' THEN JUMP TO BREAK TRANSFER SET $SPY_MESSAGE = 'REQUESTED BREAK POINTS SET' NOEVAL: TRANSFER ERROR 'CONTEXT MUST BE EVAL' NONE: TRANSFER ERROR 'NO BREAK POINTS REQUESTED' END: ERROR 'NO EXECUTABLE STATEMENTS FOUND FOLLOWING *BREAK'
CLOSE_WATCH_WINDOWS macro
********************************************* * SOFTSPY CLOSE_WATCH_WINDOWS MACRO: * * * * THIS MACRO CLOSES ALL OPEN WATCH WINDOWS. * ********************************************* * IF $CONTEXT NE 'EVAL' THEN RETURN LOOP: ACTIVE WINDOW SOURCE ACTIVE WINDOW IF $ACTIVE_WINDOW EQ 'SOURCE' THEN RETURN COMMAND 'CLOSE WINDOW ' WITH $ACTIVE_WINDOW JUMP TO LOOP
COVERAGE macro
******************************************************************* * SOFTSPY COVERAGE MACRO: * * * * DISPLAY A LINE SHOWING THE NUMBER OF TESTED STATEMENTS IN THE * * CURRENT REQUEST OUT OF THE TOTAL NUMBER OF REACHABLE STATEMENTS * * AS WELL AS THE NUMBER OF UNREACHABLE STATEMENTS. IF THE GO * * OPTION IS SPECIFIED AND EXECUTION OF THE REQUEST IS NOT * * COMPLETED THEN THE GO COMMAND IS ISSUED FIRST. * ******************************************************************* * IF $CONTEXT NE 'EVAL' THEN TRANSFER ERROR 'CONTEXT MUST BE EVAL' IF NOT $OPTION('QA') THEN TRANSFER ERROR 'QA OPTION REQUIRED' IF $MACRO_ARGS NE '' THEN JUMP TO COVERAGE_GO COVERAGE_REPORT: IF $SOURCE_LINE_INFO('TEST_STATUS',1) IS KNOWN THEN JUMP TO STATUS ERROR 'COVERAGE INFORMATION NOT COLLECTED ‑ EXECOUNT REQUIRED' RETURN STATUS: DEFINE $TESTED IS FIXED DEFINE $REACHABLE IS FIXED DEFINE $UNREACHABLE IS FIXED SET $TESTED = $COUNT_LINES('TESTED','EQ','T') SET $REACHABLE = $COUNT_LINES('REACHABLE','EQ','R') SET $UNREACHABLE = $COUNT_LINES('UNREACHABLE','EQ','U') SET $TEMP = 'ALL ' IF $TESTED EQ $REACHABLE THEN JUMP TO REACHABLE SET $TEMP = $TESTED WITH ' OF ' REACHABLE: SET $TEMP = $TEMP WITH $REACHABLE WITH ' REACHABLE STATEMENTS TESTED, ' IF $UNREACHABLE THEN SET $TEMP = $TEMP WITH $UNREACHABLE IF NOT $UNREACHABLE THEN SET $TEMP = $TEMP WITH 'NO' SET $SPY_MESSAGE = $TEMP WITH ' UNREACHABLE STATEMENTS'> RETURN COVERAGE_GO: IF $MACRO_ARGS NE 'GO' THEN TRANSFER ERROR 'INVALID COVERAGE OPTION' IF $INTERRUPT_TYPE EQ 'CANCEL' THEN JUMP TO COVERAGE_REPORT IF $INTERRUPT_TYPE EQ 'END_EVAL' THEN JUMP TO COVERAGE_REPORT IF $INTERRUPT_TYPE EQ 'USER_CANCEL' THEN JUMP TO COVERAGE_REPORT SET $SPY_MESSAGE = '' COLLECT S.EXECOUNT IF $SPY_MESSAGE NE '' THEN RETURN DEFINE $SAVED_END_EVAL_GO FIXED SET $SAVED_END_EVAL_GO = $END_EVAL_DEBUG_GO SET $END_EVAL_DEBUG_GO = 0 GO SET $END_EVAL_DEBUG_GO = $SAVED_END_EVAL_GO JUMP TO STATUS
D macro
**************************************************************** * SOFTSPY D MACRO: * * * * DISPLAY THE OPERANDS SPECIFIED. THIS IS AN ABBREVIATION FOR * * THE DISPLAY COMMAND. * **************************************************************** * COMMAND 'DISPLAY ' WITH $MACRO_ARGS
DEBUG macro
************************************************************* * SOFTSPY DEBUG MACRO: * * * * INITIALIZE OR REINITIALIZE THE SOFTSPY DEBUG ENVIRONMENT. * ************************************************************* * IF $CONTEXT EQ 'EVAL' THEN JUMP TO CONTOK IF $CONTEXT EQ 'COMPILE_ERROR' THEN JUMP TO CONTOK TRANSFER ERROR 'CONTEXT MUST BE COMPILE_ERROR OR EVAL' CONTOK: IF $OPTION('DEBUG') THEN JUMP TO DEBUG TRANSFER ERROR 'INTERACTIVE DEBUGGING OPTION NOT AVAILABLE' DEBUG: PF1 (EVAL) = HELP PF2 (EVAL) 'WINDOW' = ACTIVE WINDOW PF3 (EVAL) = QUIT PF4 (EVAL) 'STEP' = COMMAND 'STEP ' WITH $COMMAND PF5 (EVAL) 'GO' = EXEC PFKEY_GO PF6 (EVAL) 'BREAK' = EXEC TOGGLE_BREAK PF7 (EVAL) 'BACKWARD' = COMMAND 'BACKWARD ' WITH $COMMAND PF8 (EVAL) 'FORWARD' = COMMAND 'FORWARD ' WITH $COMMAND PF9 (EVAL) = REPEAT PF10(EVAL) 'WATCH' = EXEC DISPLAY_WATCH WATCH PF11(EVAL) 'DISPLAY' = EXEC DISPLAY_WATCH DISPLAY PF12(EVAL) = RETRIEVE DEFAULT LINE NEXT UNWATCH * UNSHOW * UNCOLLECT * SHOW BRACKET NEST LEN 8 ON EVAL EXEC ON_EVAL ON END_EVAL IF $END_EVAL_DEBUG_GO THEN GO IF $DEFAULT_WATCH_WINDOW NE '' THEN JUMP TO WATCH DEFINE WINDOW MONITOR ROW 1 TO 12 COLUMN 51 TO 77 OPEN WINDOW MONITOR WATCH: SET $SPY_MESSAGE = '' ON CANCEL EXEC ON_EVAL_ERROR ON NON_CANCEL EXEC ON_EVAL_ERROR * ************************************** * RUN ANY USER SPECIFIC DEBUG MACRO * ************************************** * USER: DEFINE $MACRO_NAME STRING LEN 16 LOCAL SET $MACRO_NAME = $USERID WITH '_DEBUG' IF $MACRO_EXISTS($MACRO_NAME) THEN COMMAND $MACRO_NAME
DISPLAY_WATCH macro
********************************************************************** * SOFTSPY DISPLAY_WATCH MACRO: * * * * THIS MACRO TAKES A SINGLE ARGUMENT WHICH SPECIFIES WHETHER THE * * SPECIFIED ARGUMENTS SHOULD BE DISPLAYED OR WATCHED. THE ARGUMENTS * * TO BE DISPLAYED OR WATCHED ARE: * * 1) CONTAINED ON THE COMMAND LINE IF THE COMMAND LINE IS NOT NULL * * 2) CONTAINED ON THE SOURCE LINE WHERE THE CURSOR IS LOCATED IF IT * * IS LOCATED ON A SOURCE LINE * * 3) CONTAINED ON THE CURRENT SOURCE LINE IN ALL OTHER CASES. * ********************************************************************** * DEFINE $OPERANDS STRING LEN 255 LOCAL SET $OPERANDS = $COMMAND IF $OPERANDS NE '' THEN JUMP TO DISPLAY_WATCH DEFINE $I FIXED LOCAL SET $I = $CURSOR_LINE('SOURCE') IF $I EQ 0 THEN SET $I = $CURRENT_LINE('SOURCE') DEFINE $TEXT STRING LEN 255 LOCAL SET $TEXT = $SOURCE_LINE_DATA('TEXT',$I) DEFINE $OPERAND STRING LEN 255 LOCAL DEFINE $RIGHT_PAREN STRING LEN 1 LOCAL SET $RIGHT_PAREN = ')' DEFINE $DELIMITERS STRING LEN 25 LOCAL SET $DELIMITERS = ',<>/''"\+=‑()* ' DEFINE $CHAR STRING LEN 1 LOCAL OPERAND_LOOP: SET $I = $INDEX($TEXT,'%') IF $I EQ 0 THEN JUMP TO DISPLAY_WATCH SET $TEXT = $SUBSTR($TEXT,$I) SET $I = $MATCH($TEXT,$DELIMITERS) IF $I THEN JUMP TO OPERAND_DELIMITER SET $OPERAND = $TEXT SET $TEXT = '' JUMP TO OPERAND_ADD OPERAND_DELIMITER: SET $I = $I ‑ 1 SET $OPERAND = $SUBSTR($TEXT,1,$I) SET $I = $I + 1 SET $TEXT = $SUBSTR($TEXT,$I) IF $SUBSTR($TEXT,1,1) NE '(' THEN JUMP TO OPERAND_ADD SET $I = $INDEX($TEXT,$RIGHT_PAREN) SET $OPERAND = $OPERAND WITH $SUBSTR($TEXT,1,$I) OPERAND_ADD: IF $OPERANDS NE '' THEN SET $OPERANDS = $OPERANDS WITH ', ' SET $OPERANDS = $OPERANDS WITH $OPERAND JUMP TO OPERAND_LOOP DISPLAY_WATCH: COMMAND $MACRO_ARGS WITH ' ' WITH $OPERANDS IF $MACRO_ARGS EQ 'WATCH' THEN SET $SPY_MESSAGE = ''
ERROR macro
******************************************************* * SOFTSPY ERROR MACRO: * * * * DISPLAY A USER MESSAGE ON THE SOFTSPY MESSAGE LINE, * * PREFIXED WITH 'ERROR: ' * ******************************************************* * COMMAND 'SET $SPY_MESSAGE = ''ERROR: '' WITH ' WITH $MACRO_ARGS
GLOBALS macro
********************************************************************* * SOFTSPY GLOBALS MACRO: * * * * REMOVE ALL GLOBALS CURRENTLY BEING WATCHED FROM THE DEFAULT WATCH * * WINDOW, AND WATCH THE VALUE OF ALL CURRENTLY DEFINED GLOBALS. * ********************************************************************* * IF $DEFAULT_WATCH_WINDOW NE '' THEN JUMP TO WINDOW TRANSFER ERROR 'NO DEFAULT WATCH WINDOW AVAILABLE' WINDOW: IF NOT $OPTION('DEBUG') THEN JUMP TO NODEBUG UNWATCH G.* WATCH G.* SET $SPY_MESSAGE = '' RETURN NODEBUG: ERROR 'INTERACTIVE DEBUGGING OPTION NOT AVAILABLE'
HELP_HELP macro
************************************************************ * SOFTSPY HELP_HELP MACRO: * * * * THIS MACRO IS EXECUTED WHEN HELP IS REQUESTED WITHIN THE * * HELP CONTEXT TO PROVIDE HYPERTEXT STYLE HELP * ************************************************************ * IF $CURSOR_HYPERTEXT EQ '' THEN JUMP TO ERROR TRANSFER COMMAND 'HELP ' WITH $CURSOR_HYPERTEXT ERROR: ERROR 'CURSOR NOT ON A HELP TOPIC'
HELP_QUIT macro
********************************************************************** * SOFTSPY HELP_QUIT MACRO: * * * * THIS MACRO IS EXECUTED TO QUIT OUT OF ALL NESTED HELP INVOCATIONS. * ********************************************************************** * SET $JUMP_LIMIT = 100 LOOP: IF $CONTEXT NE 'HELP' THEN RETURN QUIT NOCONFIRM JUMP TO LOOP
ON_COMPILE_ERROR macro
******************************************************************* * SOFTSPY ON_COMPILE_ERROR MACRO: * * * * THIS MACRO IS EXECUTED AFTER A REQUEST CONTAINING A COMPILATION * * ERROR IS COMPILED. * ******************************************************************* * ACTIVE WINDOW SOURCE FORWARD ERROR
ON_END_EVAL_QA macro
**************************************************************** * SOFTSPY ON_END_EVAL_QA MACRO: * * * * THIS MACRO IS INVOKED ON END OF REQUEST EVALUATION IN THE QA * * ENVIRONMENT. * **************************************************************** * IF $SKIP_END_EVAL THEN TRANSFER GO IF $END_EVAL_SCROLL_TOP THEN SCROLL TOP EXEC COVERAGE
ON_END_EVAL_TUNE macro
****************************************************************** * SOFTSPY ON_END_EVAL_TUNE MACRO: * * * * THIS MACRO IS INVOKED ON END OF REQUEST EVALUATION IN THE TUNE * * ENVIRONMENT. * ****************************************************************** * IF $SKIP_END_EVAL THEN TRANSFER GO SCROLL PFKEYS IF $END_EVAL_SCROLL_TOP THEN SCROLL TOP SET $SPY_MESSAGE = '' ON EVAL EXEC ON_EVAL_TUNE DEFINE $LINE FIXED SET $LINE = $LOCATE_LINE($SCROLLO,'MAX LT','999999999') IF NOT $LINE IS KNOWN THEN RETURN SET $TEMP = 'LARGEST ' WITH $SCROLLO WITH ' VALUE IS ' SET $TEMP = $TEMP WITH $SOURCE_LINE_INFO($SCROLLO,$LINE) IF NOT $TEMP IS KNOWN THEN RETURN DEFINE $PCT STRING LEN 20 SET $PCT = 'PERCENT ' WITH $SCROLLO SET $PCT = $SOURCE_LINE_INFO($PCT,$LINE) IF NOT $PCT IS KNOWN THEN TRANSFER SET $SPY_MESSAGE = $TEMP SET $SPY_MESSAGE = $TEMP WITH ' (' WITH $PCT WITH '% OF THE TOTAL)'
ON_EVAL macro
**************************************************************** * SOFTSPY ON_EVAL MACRO: * * * * THIS MACRO IS EXECUTED WHEN EVALUATION OF A USER LANGUAGE * * PROCEDURE IS BEGUN. IF THE PROCEDURE IS DETERMINED TO BE * * PART OF A STANDARD SUBSYSTEM THAT MIGHT BE RUN WHEN SOFTSPY * * IS ON, BUT THAT THE USER WOULD NOT WANT TO INTERACTIVELY * * EXECUTE, THEN INTERACTIVE EXECUTION IS SKIPPED. * **************************************************************** * LOOP: IF NOT $INDEX($SKIP_SUBSYSTEMS,$SUBSYS) THEN RETURN SET $TEMP = $SUBSYS WITH ' ' IF NOT $INDEX($SKIP_SUBSYSTEMS,$TEMP) THEN RETURN SET $SKIP_END_EVAL = 1 ON EVAL GO SET $SKIP_END_EVAL = 0 ON EVAL EXEC ON_EVAL JUMP TO LOOP
ON_EVAL_ERROR macro
********************************************************************** * SOFTSPY ON_EVAL_ERROR MACRO: * * * * THIS MACRO IS EXECUTED IN THE DEBUG ENVIRONMENT WHEN AN EVALUATION * * ERROR OCCURS. IT WATCHES ANY PERCENT VARIABLES CONTAINED IN THE * * STATEMENT THAT STARTS WITH THE CURRENT LINE. * ********************************************************************** * DEFINE $MESSAGE STRING LEN 255 LOCAL SET $MESSAGE = $SPY_MESSAGE DEFINE $LINE FIXED LOCAL SET $LINE = $CURRENT_LINE('SOURCE') DEFINE $TEXT STRING LEN 255 LOCAL DEFINE $I FIXED LOCAL DEFINE $OPERAND STRING LEN 255 LOCAL DEFINE $RIGHT_PAREN STRING LEN 1 LOCAL SET $RIGHT_PAREN = ')' DEFINE $DELIMITERS STRING LEN 25 LOCAL SET $DELIMITERS = ',<>?/''"{}\+=‑()*& ' LINE_LOOP: SET $TEXT = $SOURCE_LINE_DATA('TEXT',$LINE) OPERAND_LOOP: SET $I = $INDEX($TEXT,'%') IF $I EQ 0 THEN JUMP TO LINE_END SET $TEXT = $SUBSTR($TEXT,$I) SET $I = $MATCH($TEXT,$DELIMITERS) IF $I THEN JUMP TO OPERAND_DELIMITER SET $OPERAND = $TEXT SET $TEXT = '' JUMP TO OPERAND_WATCH OPERAND_DELIMITER: SET $I = $I ‑ 1 SET $OPERAND = $SUBSTR($TEXT,1,$I) SET $I = $I + 1 SET $TEXT = $SUBSTR($TEXT,$I) IF $SUBSTR($TEXT,1,1) NE '(' THEN JUMP TO OPERAND_WATCH SET $I = $INDEX($TEXT,$RIGHT_PAREN) SET $OPERAND = $OPERAND WITH $SUBSTR($TEXT,1,$I) OPERAND_WATCH: COMMAND 'WATCH ' WITH $OPERAND JUMP TO OPERAND_LOOP LINE_END: SET $LINE = $LINE + 1 IF $LINE GT $MAX_LINE('SOURCE') THEN JUMP TO END IF $SOURCE_LINE_INFO('TYPE',$LINE) EQ ' ' THEN JUMP TO LINE_LOOP END: SET $SPY_MESSAGE = $MESSAGE
ON_EVAL_TUNE macro
************************************************************ * SOFTSPY ON_EVAL_TUNE MACRO: * * * * THIS MACRO IS EXECUTED TO INITIALIZE THE SOFTSPY TUNING * * ENVIRONMENT FOR REQUEST EVALUATION TIME. * ************************************************************ * COMMAND $TUNE_PF10 COMMAND $TUNE_PF11 ON EVAL EXEC ON_EVAL TRANSFER EXEC ON_EVAL
PFKEY_GO macro
******************************************************************* * SOFTSPY PFKEY_GO COMMAND: * * * * THIS MACRO IS EXECUTED BY THE GO PROGRAM FUNCTION KEY. * ******************************************************************* * IF $COMMAND EQ '' THEN TRANSFER GO IF $SUBSTR($COMMAND,1,7) EQ 'FOREVER' THEN JUMP TO FOREVER COMMAND 'TRANSFER GO UNTIL ' WITH $COMMAND FOREVER: COMMAND 'TRANSFER GO ' WITH $COMMAND
PROFILE macro
****************************************************************** * SOFTSPY PROFILE MACRO: * * * * THIS MACRO IS EXECUTED WHEN ANY SPY COMMAND OTHER THAN SPY OFF * * IS ISSUED. IT INITIALIZES THE SOFTSPY ENVIRONMENT. * ****************************************************************** * ************************ * GENERAL DECLARATIONS * ************************ * DEFINE $END_EVAL_SCROLL_TOP FIXED SESSION DEFINE $END_EVAL_DEBUG_GO FIXED SESSION DEFINE $SCROLLO STRING LEN 15 SESSION DEFINE $SCROLLV STRING LEN 255 SESSION DEFINE $SCROLLF STRING LEN 6 SESSION DEFINE $SCROLLB STRING LEN 6 SESSION DEFINE $SCROLLPF FIXED SESSION DEFINE $SKIP_END_EVAL FIXED SESSION DEFINE $SKIP_SUBSYSTEMS STRING LEN 255 SESSION DEFINE $TEMP STRING LEN 255 SESSION * ***************************************************************** * GENERAL INSTALLATION DEFAULT SETTINGS. CHANGING THESE VALUES * * WILL CHANGE THE DEFAULT FOR YOUR INSTALLATION. * * * * WE RECOMMEND CHANGING THE DESTINATION SPECIFIED IN THE * * DEFAULT PRINTER STATEMENT TO BE A HARD-COPY PRINTER RATHER * * THAN THE TERMINAL. * * * * WE ALSO RECOMMEND INCLUDING ADDITIONAL SUBSYSTEM NAMES IN THE * * $SKIP_SUBSYSTEMS VARIABLE IF YOU HAVE ADMINISTRATIVE OR TOOL * * SUBSYSTEMS THAT MIGHT BE USED WHEN SOFTSPY IS TURNED ON, BUT * * WHICH SHOULD NEVER BE DEBUGGED. FOR EXAMPLE, IF YOU USE THE * * PLUS204 SYSTEM, YOU MIGHT WANT TO ADD THE 'USER' SUBSYSTEM TO * * THIS LIST. BE SURE TO INCLUDE A BLANK AFTER EACH SUBSYSTEM * * NAME. * * * * ADDITIONAL INFORMATION ON TAILORING THE SOFTSPY ENVIRONMENT * * CAN BE FOUND IN THE SOFTSPY REFERENCE MANUAL. LOOK UNDER * * THE HEADING 'ENVIRONMENT TAILORING' IN THE MANUAL INDEX. * * ONLINE HELP IS AVAILABLE FROM WITHIN SOFTSPY BY ISSUING THE * * COMMAND 'HELP TAILORING'. * ***************************************************************** * DEFAULT PRINTER TERMINAL SET $DEFAULT_JUMP_LIMIT = 1000 SET $END_EVAL_DEBUG_GO = 1 SET $END_EVAL_SCROLL_TOP = 1 SET $SCROLLPF = 1 SET $SKIP_SUBSYSTEMS = 'SOFTSPY SSTEST ' * ************************************************** * DEFAULT SETTINGS FOR THE BROWSE SCREEN CONTEXT * ************************************************** * PF1 (BROWSE) = HELP BROWSE ENVIRONMENT PF2 (BROWSE) = PRINT WINDOW PF3 (BROWSE) = QUIT PF4 (BROWSE) = TOP PF5 (BROWSE) = BOTTOM PF7 (BROWSE) 'BACKWARD' = COMMAND 'BACKWARD ' WITH $COMMAND PF8 (BROWSE) 'FORWARD' = COMMAND 'FORWARD ' WITH $COMMAND PF9 (BROWSE) = REPEAT PF12(BROWSE) = RETRIEVE * ********************************************************* * DEFAULT SETTINGS FOR THE COMPILE_ERROR SCREEN CONTEXT * ********************************************************* * IF $CONTEXT NE 'EVAL' THEN JUMP TO END_COMPILE_ERROR PF1 (COMPILE_ERROR) = HELP COMPILE_ERROR ENVIRONMENT PF2 (COMPILE_ERROR) 'WINDOW' = ACTIVE WINDOW PF3 (COMPILE_ERROR) = QUIT NOCONFIRM PF4 (COMPILE_ERROR) 'LEFT' = COMMAND 'LEFT ' WITH $COMMAND PF5 (COMPILE_ERROR) 'RIGHT' = COMMAND 'RIGHT ' WITH $COMMAND PF7 (COMPILE_ERROR) 'BACKWARD' = COMMAND 'BACKWARD ' WITH $COMMAND PF8 (COMPILE_ERROR) 'FORWARD' = COMMAND 'FORWARD ' WITH $COMMAND PF9 (COMPILE_ERROR) = REPEAT PF10(COMPILE_ERROR) '-ERROR' = IN SOURCE BACKWARD ERROR PF11(COMPILE_ERROR) '+ERROR' = IN SOURCE FORWARD ERROR PF12(COMPILE_ERROR) = RETRIEVE ON COMPILE_ERROR EXEC ON_COMPILE_ERROR END_COMPILE_ERROR: * ************************************************** * DEFAULT SETTINGS FOR THE CONFIG SCREEN CONTEXT * ************************************************** * PF1 (CONFIG) = HELP CONFIG ENVIRONMENT PF3 (CONFIG) = QUIT PF4 (CONFIG) = TOP PF5 (CONFIG) = BOTTOM PF6 (CONFIG) = SAVE PF7 (CONFIG) = BACKWARD PF8 (CONFIG) = FORWARD PF9 (CONFIG) = REPEAT PF10(CONFIG) 'ACLS' = COMMAND 'LIST ACL ' WITH $COMMAND PF11(CONFIG) 'MACROS' = COMMAND 'LIST MACRO ' WITH $COMMAND PF12(CONFIG) = RETRIEVE * ************************************************ * DEFAULT SETTINGS FOR THE EDIT SCREEN CONTEXT * ************************************************ * PF1 (EDIT) = HELP EDIT ENVIRONMENT PF2 (EDIT) = PRINT WINDOW PF3 (EDIT) = QUIT PF4 (EDIT) = TOP PF5 (EDIT) = BOTTOM PF6 (EDIT) 'SAVE' = COMMAND 'SAVE ' WITH $COMMAND PF7 (EDIT) 'BACKWARD' = COMMAND 'BACKWARD ' WITH $COMMAND PF8 (EDIT) 'FORWARD' = COMMAND 'FORWARD ' WITH $COMMAND PF9 (EDIT) = REPEAT PF12(EDIT) = RETRIEVE * ************************************************ * DEFAULT SETTINGS FOR THE EVAL SCREEN CONTEXT * ************************************************ * IF $CONTEXT NE 'EVAL' THEN JUMP TO END_EVAL IF $OPTION('DEBUG') THEN EXEC DEBUG IF $OPTION('DEBUG') THEN JUMP TO END_EVAL IF $OPTION('TUNE') THEN EXEC TUNE IF $OPTION('TUNE') THEN JUMP TO END_EVAL IF $OPTION('QA') THEN EXEC QA IF $OPTION('QA') THEN JUMP TO END_EVAL TRANSFER ERROR 'NO SOFTSPY FEATURES ARE AVAILABLE' END_EVAL: * ************************************************ * DEFAULT SETTINGS FOR THE HELP SCREEN CONTEXT * ************************************************ * PF1 (HELP) 'HELP' = EXEC HELP_HELP PF2 (HELP) = PRINT WINDOW PF3 (HELP) = QUIT PF4 (HELP) = TOP PF5 (HELP) = BOTTOM PF6 (HELP) 'QUIT HELP' = EXEC HELP_QUIT PF7 (HELP) 'BACKWARD' = COMMAND 'BACKWARD ' WITH $COMMAND PF8 (HELP) 'FORWARD' = COMMAND 'FORWARD ' WITH $COMMAND PF9 (HELP) = REPEAT PF10(HELP) 'HELP MENU' = HELP PF11(HELP) 'HELP LIST' = HELP * PF12(HELP) = RETRIEVE * ************************************************ * DEFAULT SETTINGS FOR THE LIST SCREEN CONTEXT * ************************************************ * PF1 (LIST) = HELP LIST ENVIRONMENT PF2 (LIST) = PRINT WINDOW PF3 (LIST) = QUIT PF4 (LIST) = TOP PF5 (LIST) = BOTTOM PF7 (LIST) 'BACKWARD' = COMMAND 'BACKWARD ' WITH $COMMAND PF8 (LIST) 'FORWARD' = COMMAND 'FORWARD ' WITH $COMMAND PF9 (LIST) = REPEAT PF12(LIST) = RETRIEVE * *************************************** * RUN ANY USER SPECIFIC PROFILE MACRO * *************************************** * DEFINE $MACRO_NAME STRING LEN 18 LOCAL SET $MACRO_NAME = $USERID WITH '_PROFILE' IF $MACRO_EXISTS($MACRO_NAME) THEN COMMAND $MACRO_NAME
QA macro
********************************************************** * SOFTSPY QA MACRO: * * * * INITIALIZE OR REINITIALIZE THE SOFTSPY QA ENVIRONMENT. * ********************************************************** * IF $CONTEXT EQ 'EVAL' THEN JUMP TO EVAL TRANSFER ERROR 'CONTEXT MUST BE EVAL' EVAL: IF $OPTION('QA') THEN JUMP TO QA TRANSFER ERROR 'INTERACTIVE QA OPTION NOT AVAILABLE' QA: PF1 (EVAL) = HELP PF2 (EVAL) = PRINT WINDOW PF3 (EVAL) = QUIT PF4 (EVAL) 'STEP' = COMMAND 'STEP ' WITH $COMMAND PF5 (EVAL) 'GO' = EXEC PFKEY_GO PF6 (EVAL) 'BREAK' = EXEC TOGGLE_BREAK PF7 (EVAL) 'BACKWARD' = COMMAND 'BACKWARD ' WITH $COMMAND PF8 (EVAL) 'FORWARD' = COMMAND 'FORWARD ' WITH $COMMAND PF9 (EVAL) = REPEAT PF12(EVAL) = RETRIEVE DEFAULT LINE NEXT UNSHOW * UNCOLLECT * SHOW C.LINENO, Q.REACH_STATUS, Q.UNTESTED SHOW EXECOUNT LEN 6 TITLE 'TIMES' 'TESTED' SET $SPY_MESSAGE = '' SCROLL PFKEYS SCROLL UNTESTED ON EVAL EXEC ON_EVAL ON END_EVAL EXEC ON_END_EVAL_QA EXEC CLOSE_WATCH_WINDOWS * ************************************ * RUN ANY USER SPECIFIC QA MACRO * ************************************ * DEFINE $MACRO_NAME STRING LEN 15 LOCAL SET $MACRO_NAME = $USERID WITH '_QA' IF $MACRO_EXISTS($MACRO_NAME) THEN COMMAND $MACRO_NAME
QQUIT macro
****************************** * SOFTSPY QQUIT MACRO: * * * * QUIT WITHOUT CONFIRMATION. * ****************************** * QUIT NOCONFIRM
QUAD macro
******************************************************************* * SOFTSPY QUAD MACRO: * * * * SYNTAX: QUAD QUAD_OFFSET [PROCEDURE_NAME ] * * * * THIS MACRO SETS THE CURRENT LINE TO THE LINE CONTAINING THE * * SPECIFIED QUAD OFFSET WITHIN THE SPECIFIED PROCEDURE. * ******************************************************************* * DEFINE $LINE IS FIXED LOCAL DEFINE $MSG IS STRING LEN 80 LOCAL DEFINE $OPERANDS IS STRING LEN 255 LOCAL DEFINE $PROC IS STRING LEN 255 LOCAL DEFINE $QUAD IS STRING LEN 10 LOCAL DEFINE $QUAD_NUM IS STRING LEN 10 LOCAL DEFINE $SPACE IS FIXED LOCAL * VALIDATE_CONTEXT: IF $CONTEXT EQ 'EVAL' THEN JUMP TO VALIDATE_OPTION TRANSFER ERROR 'CONTEXT MUST BE EVAL' * VALIDATE_OPTION: IF C.QTBL IS KNOWN THEN JUMP TO VALIDATE_ARGS TRANSFER ERROR 'AUDIT OPTION NOT AVAILABLE' * VALIDATE_ARGS: IF $MACRO_ARGS NE '' THEN JUMP TO PARSE_ARGS TRANSFER ERROR 'A QUAD OFFSET MUST BE SPECIFIED' * PARSE_ARGS: SET $OPERANDS = $MACRO_ARGS SET $SPACE = $INDEX($OPERANDS,' ') IF $SPACE EQ 0 THEN JUMP TO QUAD_ARG_ONLY * ******************************************************************* * MORE THAN ONE ARGUMENT PASSED, PARSE THEM TO DETERMINE THE QUAD * * OFFSET AND PROCEDURE NAME. * ******************************************************************* SET $SPACE = $SPACE ‑ 1 SET $QUAD = $SUBSTR($OPERANDS,1,$SPACE) SET $SPACE = $SPACE + 2 SET $PROC = $SUBSTR($OPERANDS,$SPACE) * ******************************************************************* * IF THE PROCEDURE NAME CONTAINS LEADING BLANKS REMOVE THEM. * ******************************************************************* DEBLANK_PROCNAME: IF $INDEX($PROC,' ') NE 1 THEN JUMP TO VALIDATE_CURRPROC SET $PROC = $SUBSTR($PROC,2) JUMP TO DEBLANK_PROCNAME * QUAD_ARG_ONLY: SET $PROC = '' SET $QUAD = $OPERANDS JUMP TO VALIDATE_QUAD * ******************************************************************* * VALIDATE THE PROCEDURE NAME USING MODEL 204 VALIDATION RULES. * ******************************************************************* VALIDATE_CURRPROC: IF $PROC NE $PROCNAME THEN JUMP TO VALIDATE_PROCNAME TRANSFER ERROR 'CURRENT PROCEDURE IS INVALID' * VALIDATE_PROCNAME: IF $INDEX($PROC,'‑') EQ 1 THEN JUMP TO VALIDATE_ADHOC_NAME IF $MATCH($PROC,' =,''') EQ 0 THEN JUMP TO VALIDATE_QUAD IF $MATCH($PROC,'''') EQ 0 THEN JUMP TO PROC_ERROR_NOQUOTE TRANSFER ERROR 'INVALID PROCEDURE NAME: QUOTES ARE NOT ALLOWED' * PROC_ERROR_NOQUOTE: SET $MSG = 'INVALID PROCEDURE NAME: ' WITH $PROC COMMAND 'TRANSFER ERROR ' WITH '''' WITH $MSG WITH '''' * VALIDATE_ADHOC_NAME: IF $PROC IS NUM LT 0 THEN JUMP TO VALIDATE_QUAD SET $MSG = 'INVALID PROCEDURE NAME: ' WITH $PROC COMMAND 'TRANSFER ERROR ' WITH '''' WITH $MSG WITH '''' * ******************************************************************* * VALIDATE THE QUAD OFFSET IS BETWEEN 0 AND LARGEST QTBL (INCL). * ******************************************************************* VALIDATE_QUAD: SET $QUAD_NUM = +$QUAD IF $QUAD_NUM IS KNOWN THEN JUMP TO VALIDATE_QUAD_MIN TRANSFER ERROR 'QUAD OFFSET MUST BE NUMERIC' * VALIDATE_QUAD_MIN: IF $QUAD IS NUM GE 0 THEN JUMP TO VALIDATE_QUAD_TMAX TRANSFER ERROR 'QUAD OFFSET MUST GREATER THAN OR EQUAL TO 0' * VALIDATE_QUAD_TMAX: IF $PROC EQ '' THEN JUMP TO VALIDATE_QUAD_MAX IF $QUAD IS NUM LE 262128 THEN JUMP TO GOUNTIL TRANSFER ERROR 'QUAD OFFSET MUST BE LESS THAN OR QUEAL TO 262,128' * GOUNTIL: IF $PROC EQ '' THEN JUMP TO VALIDATE_QUAD_MAX COMMAND 'GO UNTIL $PROCNAME = ''' WITH $PROC WITH '''' IF $INTERRUPT_TYPE = 'EVAL' AND $PROCNAME NE $PROC THEN JUMP TO GOUNTIL IF $PROCNAME NE $PROC THEN RETURN * VALIDATE_QUAD_MAX: IF $QUAD IS NUM LE C.QTBL THEN JUMP TO FIND_THE_QUAD SET $MSG = 'QUAD OFFSET ' WITH $QUAD SET $MSG = $MSG WITH ' DOES NOT EXIST IN THE CURRENT PROCEDURE' COMMAND 'TRANSFER ERROR ' WITH '''' WITH $MSG WITH '''' * FIND_THE_QUAD: SET $LINE = $LOCATE_LINE('C.QTBL','MIN GT',$QUAD) SET $CURRENT_LINE('SOURCE') = $LINE * SET $MSG = 'QUAD OFFSET ' WITH $QUAD SET $MSG = $MSG WITH ' IS WITHIN THE HIGHLIGHTED LINE' SET $SPY_MESSAGE = $MSG
SCROLL macro
*********************************************************************** * SOFTSPY SCROLL MACRO: * * * * THIS MACRO SUPPORTS SCROLLING WITHIN THE SOURCE WINDOW BASED ON THE * * VALUE OF OPERANDS. THIS MACRO TRANSFERS TO THE SCROLL_SET MACRO TO * * HANDLE SPECIFICATION OF THE SCROLLING SET, THE ORDER OF LINES IN * * THE SCROLL SET, AND THE ESTABLISHMENT OF SCROLLING FUNCTION KEYS. * * THIS CODE IN THIS MACRO SUPPORTS FORWARD, BACKWARD, TOP, AND BOTTOM * * SCROLLING WITHIN THE SET. * *********************************************************************** * IF $CONTEXT EQ 'EVAL' THEN JUMP TO EVAL IF $CONTEXT EQ 'COMPILE_ERROR' THEN JUMP TO EVAL TRANSFER ERROR 'CONTEXT MUST BE COMPILE_ERROR OR EVAL' EVAL: DEFINE $L IS FIXED DEFINE $N IS FIXED IF $MACRO_ARGS EQ '' THEN JUMP TO FORWARD IF $MACRO_ARGS EQ '+' THEN JUMP TO FORWARD IF $MACRO_ARGS EQ '-' THEN JUMP TO BACKWARD IF $MACRO_ARGS EQ 'TOP' THEN JUMP TO TOP IF $MACRO_ARGS EQ 'BOTTOM' THEN JUMP TO BOTTOM TRANSFER COMMAND 'EXEC SCROLL_SET ' WITH $MACRO_ARGS FORWARD: IF $SCROLLO EQ '' THEN JUMP TO NO_SCROLL SET $L = $CURRENT_LINE('SOURCE') + 1 IF $LEN($SCROLLF) NE 2 THEN JUMP TO FORWARD_ORDERED IF $L IS NUM GT $MAX_LINE('SOURCE') THEN JUMP TO NOT_FOUND SET $N = $LOCATE_LINE($SCROLLO,$SCROLLF,$SCROLLV,$L) JUMP TO CHECK_FOUND FORWARD_ORDERED: SET $N = $CURRENT_LINE('SOURCE') SET $SCROLLV = $SOURCE_LINE_INFO($SCROLLO,$N) IF $L IS NUM GT $MAX_LINE('SOURCE') THEN JUMP TO FORWARD_VALUE SET $N = $LOCATE_LINE($SCROLLO,'EQ',$SCROLLV,$L) IF $N IS KNOWN THEN JUMP TO FOUND FORWARD_VALUE: SET $N = $LOCATE_LINE($SCROLLO,$SCROLLF,$SCROLLV) JUMP TO CHECK_FOUND BACKWARD: IF $SCROLLO EQ '' THEN JUMP TO NO_SCROLL SET $L = $CURRENT_LINE('SOURCE') - 1 IF $LEN($SCROLLB) NE 2 THEN JUMP TO BACKWARD_ORDERED IF $L IS NUM LT 1 THEN JUMP TO NOT_FOUND SET $N = $LOCATE_LINE($SCROLLO,$SCROLLB,$SCROLLV,$L,1) JUMP TO CHECK_FOUND BACKWARD_ORDERED: SET $N = $CURRENT_LINE('SOURCE') SET $SCROLLV = $SOURCE_LINE_INFO($SCROLLO,$N) IF $L IS NUM LT 1 THEN JUMP TO BACKWARD_VALUE SET $N = $LOCATE_LINE($SCROLLO,'EQ',$SCROLLV,$L,1) IF $N IS KNOWN THEN JUMP TO FOUND BACKWARD_VALUE: SET $L = $MAX_LINE('SOURCE') SET $N = $LOCATE_LINE($SCROLLO,$SCROLLB,$SCROLLV,$L,1) JUMP TO CHECK_FOUND TOP: IF $SCROLLO EQ '' THEN JUMP TO NO_SCROLL IF $LEN($SCROLLB) NE 2 THEN JUMP TO TOP_ORDERED SET $N = $LOCATE_LINE($SCROLLO,$SCROLLB,$SCROLLV) JUMP TO CHECK_FOUND TOP_ORDERED: SET $SCROLLV = '999999999999999' IF $SCROLLF EQ 'MIN GT' THEN SET $SCROLLV = '-999999999999999' JUMP TO FORWARD_VALUE BOTTOM: IF $SCROLLO EQ '' THEN JUMP TO NO_SCROLL IF $LEN($SCROLLF) NE 2 THEN JUMP TO BOTTOM_ORDERED SET $N = $MAX_LINE('SOURCE') SET $N = $LOCATE_LINE($SCROLLO,$SCROLLF,$SCROLLV,$N,1) JUMP TO CHECK_FOUND BOTTOM_ORDERED: SET $SCROLLV = '999999999999999' IF $SCROLLB EQ 'MIN GT' THEN SET $SCROLLV = '-999999999999999' JUMP TO BACKWARD_VALUE CHECK_FOUND: IF $N IS UNKNOWN THEN JUMP TO NOT_FOUND FOUND: SET $CURRENT_LINE('SOURCE') = $N RETURN NOT_FOUND: ERROR 'LINE NOT FOUND' RETURN NO_SCROLL: ERROR 'NO SCROLL SET DEFINED'
SCROLL_SET macro
*********************************************************************** * SOFTSPY SCROLL_SET MACRO: * * * * THIS MACRO IS INVOKED BY THE SCROLL MACRO TO PROCESS THE DEFINITION * * OF A SCROLLING SET AND THE SPECIFICATION OF PROGRAM FUNCTION KEYS * * FOR SCROLLING. * *********************************************************************** DEFINE $TEMPO IS STRING LEN 15 DEFINE $TEMPV IS STRING LEN 255 DEFINE $TEMPF IS STRING LEN 6 DEFINE $TEMPB IS STRING LEN 6 DEFINE $N IS STRING LEN 22 DEFINE $S IS STRING LEN 255 SET $S = $MACRO_ARGS SET $N = $INDEX($S,' ') IF $N THEN JUMP TO MULTIPLE_TOKENS IF $MACRO_ARGS EQ 'PFKEYS' THEN JUMP TO PFKEYS IF $MACRO_ARGS EQ 'NOPFKEYS' THEN JUMP TO NOPFKEYS SET $TEMPO = $MACRO_ARGS SET $TEMPF = 'NE' SET $TEMPB = 'NE' SET $TEMPV = ' ' IF $LOCATE_LINE($TEMPO,'MIN GT',0) IS INVALID THEN JUMP TO SET SET $TEMPV = 0 SET: SET $N = $LOCATE_LINE($TEMPO,$TEMPF,$TEMPV) IF $N IS UNDEFINED OR $N IS INVALID THEN JUMP TO INVALID IF $N IS NOT AVAILABLE THEN JUMP TO NOT_AVAILABLE SET $SCROLLO = $TEMPO SET $SCROLLV = $TEMPV SET $SCROLLF = $TEMPF SET $SCROLLB = $TEMPB IF NOT $SCROLLPF THEN RETURN PFKEYS: SET $SCROLLPF=1 IF $SCROLLO EQ '' THEN RETURN DEFINE $LABEL IS STRING LEN 8 SET $LABEL = $SCROLLO COMMAND 'PF10(EVAL) ''‑' WITH $LABEL WITH ''' = SCROLL ‑' COMMAND 'PF11(EVAL) ''+' WITH $LABEL WITH ''' = SCROLL' RETURN NOPFKEYS: TRANSFER SET $SCROLLPF=0 MULTIPLE_TOKENS: SET $N = $N‑1 SET $TEMPO = $SUBSTR($S,1,$N) SET $N = $N+1 SET $S = $SUBSTR($S,$N) SET $N = $UNMATCH($S,' ') IF NOT $N THEN JUMP TO BAD_SYNTAX SET $S = $SUBSTR($S,$N) IF $TEMPO EQ 'MIN' OR $TEMPO EQ 'MAX' THEN JUMP TO MIN_MAX SET $N = $INDEX($S,' ') IF NOT $N THEN JUMP TO BAD_SYNTAX SET $N = $N‑1 SET $TEMPF = $SUBSTR($S,1,$N) SET $TEMPB = $TEMPF IF $TEMPF NE 'EQ' AND $TEMPF NE 'NE' THEN JUMP TO BAD_SYNTAX SET $N = $N+1 SET $S = $SUBSTR($S,$N) SET $N = $UNMATCH($S,' ') IF NOT $N THEN JUMP TO BAD_SYNTAX SET $S = $SUBSTR($S,$N) SET $TEMPV = $S IF NOT $UNMATCH($S,'-0123456789') THEN JUMP TO SET SET $N = $LEN($S) IF $N IS NUM LT 2 THEN JUMP TO BAD_SYNTAX IF $SUBSTR($S,1,1) NE $SUBSTR($S,$N,1) THEN JUMP TO BAD_SYNTAX SET $N = $N-2 SET $TEMPV = $SUBSTR($S,2,$N) SET $S = $SUBSTR($S,1,1) IF NOT $UNMATCH($S,'''"') THEN JUMP TO SET JUMP TO BAD_SYNTAX MIN_MAX: SET $TEMPF = 'MIN GT' SET $TEMPB = 'MAX LT' IF $TEMPO EQ 'MAX' THEN SET $TEMPF = 'MAX LT' IF $TEMPO EQ 'MAX' THEN SET $TEMPB = 'MIN GT' SET $TEMPO = $S SET $TEMPV = 0 JUMP TO SET INVALID: SET $SPY_MESSAGE = $TEMPO WITH ' IS NOT A VALID SCROLLING OPERAND' ERROR $SPY_MESSAGE RETURN NOT_AVAILABLE: SET $SPY_MESSAGE = $TEMPO WITH ' IS NOT AVAILABLE' ERROR $SPY_MESSAGE RETURN BAD_SYNTAX: SET $SPY_MESSAGE = $MACRO_ARGS WITH ' IS INVALID SCROLL MACRO SYNTAX' ERROR $SPY_MESSAGE
STATS macro
************************************************************* * SOFTSPY STATS MACRO: * * * * ADD ALL STATISTICS OPERANDS AND ALL SERVER TABLE OPERANDS * * TO THE DEFAULT WATCH WINDOW. * ************************************************************* * IF $CONTEXT EQ 'EVAL' THEN JUMP TO EVAL IF $CONTEXT EQ 'COMPILE_ERROR' THEN JUMP TO EVAL TRANSFER ERROR 'CONTEXT MUST BE EVAL' EVAL: IF $DEFAULT_WATCH_WINDOW NE '' THEN JUMP TO WINDOW OPEN WINDOW MONITOR ROW 1 TO 12 COLUMN 51 TO 77 WINDOW: IF NOT $OPTION('TUNE') THEN JUMP TO NOTUNE WATCH AUDIT IF P.VERSION GE '3.2' THEN WATCH BACKOUTS WATCH BADD,BCHG,BDEL,BXCHNG,BXDELE,BXFIND,BXFREE,BXINSE WATCH BXNEXT,BXRFND,BXSPLI,CCATEMP,CNCT IF P.VERSION GE '3.2' THEN WATCH COMMITS WATCH CPU,DIRRCD,DKAR,DKPR,DKRD,DKRR,DKWR,DUMP NOTUNE: IF S.EXECOUNT IS KNOWN THEN WATCH EXECOUNT IF NOT $OPTION('TUNE') THEN JUMP TO SERVER WATCH FBWT,FINDS,IXADD,IXDEL IF P.VERSION GE '3.2' THEN WATCH LONGUPDTS,S.'LONGUPDTIME(MS)' WATCH MOVE IF P.VERSION GE '3.2' THEN WATCH PBRSFLT WATCH RECADD,RECDEL,RECDS,REQ,REST,SCHDCPU,SCREENS,SVPAGES WATCH SGMTI,SGMTO,SLIC,SORTS,SQRD,SQWR,STCPU,STDEQ,STRECDS WATCH SVRD,SVWR,UDD IF P.VERSION GE '3.2' THEN WATCH S.'UPDTTIME(MS)' WATCH WAIT SERVER: WATCH 'SERVER TABLE USAGE' WATCH SERVER,FSCB,FTBL,GTBL,ITBL,NTBL,OUTPB,PDL,QTBL,RTBL WATCH STBL,TTBL,VTBL,XTBL COMMAND 'IN WINDOW ' WITH $DEFAULT_WATCH_WINDOW WITH ' -/AUDIT' SET $SPY_MESSAGE = ''
TOGGLE_BREAK macro
************************************************************ * SOFTSPY TOGGLE_BREAK MACRO: * * * * THIS MACRO IS EXECUTED TO TOGGLE A BREAK POINT ON OR OFF * * ON THE LINE WHERE THE CURSOR IS IF IT IS ON A SOURCE * * PROGRAM LINE, OR THE CURRENT LINE OTHERWISE. * ************************************************************ * IF $CONTEXT NE 'EVAL' THEN TRANSFER ERROR 'CONTEXT MUST BE EVAL' DEFINE $BREAK_LINE FIXED LOCAL DEFINE $CURSOR_POS FIXED LOCAL DEFINE $OLD_CURRENT FIXED LOCAL SET $BREAK_LINE = $CURRENT_LINE('SOURCE') SET $CURSOR_POS = $CURSOR_LINE('SOURCE') SET $OLD_CURRENT = $BREAK_LINE IF NOT $CURSOR_POS THEN JUMP TO SET SET $BREAK_LINE = $CURSOR_POS SET $CURRENT_LINE('SOURCE') = $BREAK_LINE SET: IF $SOURCE_LINE_DATA('BREAK',$BREAK_LINE) THEN JUMP TO CLEAR BREAK JUMP TO END CLEAR: CLEAR BREAK END: IF $BREAK_LINE EQ $OLD_CURRENT THEN RETURN SET $CURRENT_LINE('SOURCE') = $OLD_CURRENT
TOP macro
******************************************* * SOFTSPY TOP MACRO: * * * * SCROLL TO THE TOP OF THE ACTIVE WINDOW. * ******************************************* * BACKWARD 99999
TRACER macro
*********************************************************************** * SOFTSPY TRACER MACRO * * * * USER LANGUAGE REQUEST. TRACER WILL BEGIN TRACING STARTING WITH THE * * NEXT STATEMENT TO BE EXECUTED AND WILL TRACE UNTIL THE END OF THE * * REQUEST, UNTIL A BREAKPOINT HAS BEEN REACHED, OR UNTIL A CANCELLING * * OR NON-CANCELLING ERROR HAS OCCURED. * * * * SET A BREAK POINT IF YOU WANT THE TRACE TO STOP BEFORE THE REQUEST * * HAS FINISHED EXECUTING. * *********************************************************************** * IF $CONTEXT NE 'EVAL' THEN TRANSFER ERROR 'CONTEXT MUST BE EVAL' PRINT LINE $PAD('*','*',70) DEFINE $SUFFIX IS STRING LEN 255 IF $PROCFILE NE THEN SET $SUFFIX = ' IN ' WITH $PROCFILE PRINT LINE '* TRACE OF ' WITH $PROCNAME WITH $SUFFIX PRINT LINE '* REQUESTED BY ' WITH $USERID PRINT LINE $PAD('*','*',70) DEFINE $DEFAULT_LINE_NEXT FIXED DEFINE $L FIXED DEFINE $HISTORY_COUNT FIXED DEFINE $SAVED_END_EVAL_GO FIXED SET $SAVED_END_EVAL_GO = $END_EVAL_DEBUG_GO SET $END_EVAL_DEBUG_GO = 0 STEP SET $SPY_MESSAGE = NEXT IF $SPY_MESSAGE NE THEN SET $DEFAULT_LINE_NEXT = 1 SET $SPY_MESSAGE = DEFAULT LINE LAST SET $L = $CURRENT_LINE('SOURCE') PRINT LINE $PAD($L,' ',5) WITH ' ' WITH $SOURCE_LINE_DATA('TEXT',$L) IF $LEN($INTERRUPT_TYPE) THEN JUMP TO DONE IF NOT $OPTION('QA') THEN JUMP TO SLOW_LOOP DEFINE $HISTORY_COUNT FIXED FAST_LOOP: SET $HISTORY_COUNT = S.EXECOUNT STEP 99 SET $HISTORY_COUNT = S.EXECOUNT - $HISTORY_COUNT NEXT COMMAND 'LAST ' WITH $HISTORY_COUNT HISTORY_LOOP: SET $L = $CURRENT_LINE('SOURCE') PRINT LINE $PAD($L,' ',5) WITH ' ' WITH $SOURCE_LINE_DATA('TEXT',$L) NEXT SET $HISTORY_COUNT = $HISTORY_COUNT - 1 IF $HISTORY_COUNT THEN JUMP TO HISTORY_LOOP IF $INTERRUPT_TYPE EQ THEN JUMP TO FAST_LOOP JUMP TO DONE SLOW_LOOP: STEP SET $L = $CURRENT_LINE('SOURCE') PRINT LINE $PAD($L,' ',5) WITH ' ' WITH $SOURCE_LINE_DATA('TEXT',$L) IF $INTERRUPT_TYPE EQ THEN JUMP TO SLOW_LOOP DONE: PRINT LINE $PAD('*','*',70) PRINT LINE '* TERMINATED BY ' WITH $INTERRUPT_TYPE PRINT LINE $PAD('*','*',70) SET $SPY_MESSAGE = SET $END_EVAL_DEBUG_GO = $SAVED_END_EVAL_GO IF $DEFAULT_LINE_NEXT THEN DEFAULT LINE NEXT
TUNE macro
************************************************************************************ * SOFTSPY TUNE MACRO: * * * * INITIALIZE OR REINITIALIZE THE SOFTSPY TUNE ENVIRONMENT. * ************************************************************************************ * IF $CONTEXT EQ 'EVAL' THEN JUMP TO EVAL TRANSFER ERROR 'CONTEXT MUST BE EVAL' EVAL: IF $OPTION('TUNE') THEN JUMP TO TUNE TRANSFER ERROR 'INTERACTIVE TUNING OPTION NOT AVAILABLE' TUNE: PF1 (EVAL) = HELP PF2 (EVAL) = PRINT WINDOW PF3 (EVAL) = QUIT PF4 (EVAL) 'STEP' = COMMAND 'STEP ' WITH $COMMAND PF5 (EVAL) 'GO' = EXEC PFKEY_GO PF6 (EVAL) 'BREAK' = EXEC TOGGLE_BREAK PF7 (EVAL) 'BACKWARD' = COMMAND 'BACKWARD ' WITH $COMMAND PF8 (EVAL) 'FORWARD' = COMMAND 'FORWARD ' WITH $COMMAND PF9 (EVAL) = REPEAT DEFINE $TUNE_PF10 STRING 255 SESSION SET $TUNE_PF10 = "PF10(EVAL) 'PAGE REQ' = GO UNTIL DKPR(STMT)" DEFINE $TUNE_PF11 STRING 255 SESSION SET $TUNE_PF11 = "PF11(EVAL) 'FIND STMT' = GO UNTIL FINDS(STMT)" PF12(EVAL) = RETRIEVE DEFAULT LINE LAST UNSHOW * UNCOLLECT * SHOW CPU TITLE 'CPU', DKPR TITLE 'PAGE' 'REQ' SHOW AVERAGE CCATEMP TITLE 'CCA' 'TEMP' SET $SPY_MESSAGE = SCROLL PFKEYS SCROLL MAX CPU ON EVAL EXEC ON_EVAL ON END_EVAL EXEC ON_END_EVAL_TUNE EXEC CLOSE_WATCH_WINDOWS * ***************************************************** * RUN ANY USER SPECIFIC TUNE MACRO * ***************************************************** * DEFINE $MACRO_NAME STRING LEN 15 LOCAL SET $MACRO_NAME = $USERID WITH '_TUNE' IF $MACRO_EXISTS($MACRO_NAME) THEN COMMAND $MACRO_NAME COMMAND $TUNE_PF10 COMMAND $TUNE_PF11
UNREACH macro
********************************************************************************************** * SOFTSPY UNREACH MACRO: * * * * FIND THE "NEXT" UNREACHABLE LINE RELATIVE TO CURRENT LINE. * * IF SUCH A LINE IS FOUND, IT IS MADE THE CURRENT LINE. * * OTHERWISE, A MESSAGE IS ISSUED, AND THE CURRENT LINE REMAINS * * UNCHANGED. * * * * A DIRECTION OF FORWARD IS ASSUMED UNLESS A "-" IS PASSED TO * * INDICATE BACKWARD. * ********************************************************************************************** * IF $CONTEXT NE 'EVAL' THEN TRANSFER ERROR 'CONTEXT MUST BE EVAL' IF NOT $OPTION('QA') THEN TRANSFER ERROR 'QA OPTION REQUIRED' DEFINE $L IS FIXED DEFINE $LL IS FIXED IF $MACRO_ARGS EQ '-' THEN JUMP TO BACK SET $L = $CURRENT_LINE('SOURCE') + 1 IF $L IS NUM GT $MAX_LINE('SOURCE') THEN JUMP TO NONE SET $LL = $LOCATE_LINE('UNREACHABLE','NE',' ',$L) CHECK: IF NOT $LL IS KNOWN THEN JUMP TO NONE SET $CURRENT_LINE('SOURCE') = $LL RETURN BACK: SET $L = $CURRENT_LINE('SOURCE') - 1 IF $L IS NUM LT 1 THEN JUMP TO NONE SET $LL = $LOCATE_LINE('UNREACHABLE','NE',' ',$L,1) JUMP TO CHECK NONE: SET $SPY_MESSAGE = 'NO MORE UNREACHABLE STATEMENTS FOUND.'
UNTESTED macro
********************************************************************************************* * SOFTSPY UNTESTED MACRO: * * * * FIND THE "NEXT" UNTESTED LINE RELATIVE TO CURRENT LINE. * * IF SUCH A LINE IS FOUND, IT IS MADE THE CURRENT LINE. * * OTHERWISE, A MESSAGE IS ISSUED, AND THE CURRENT LINE REMAINS * * UNCHANGED. * * * * A DIRECTION OF FORWARD IS ASSUMED UNLESS A "-" IS PASSED TO * * INDICATE BACKWARD. * ********************************************************************************************* * IF $CONTEXT NE 'EVAL' THEN TRANSFER ERROR 'CONTEXT MUST BE EVAL' IF NOT $OPTION('QA') THEN TRANSFER ERROR 'QA OPTION REQUIRED' DEFINE $L IS FIXED DEFINE $LL IS FIXED IF $MACRO_ARGS EQ '-' THEN JUMP TO BACK SET $L = $CURRENT_LINE('SOURCE') + 1 IF $L IS NUM GT $MAX_LINE('SOURCE') THEN JUMP TO NONE SET $LL = $LOCATE_LINE('UNTESTED','NE',' ',$L) CHECK: IF NOT $LL IS KNOWN THEN JUMP TO BAD PRINT LINE $LL SET $CURRENT_LINE('SOURCE') = $LL RETURN BACK: SET $L = $CURRENT_LINE('SOURCE') - 1 IF $L IS NUM LT 1 THEN JUMP TO NONE SET $LL = $LOCATE_LINE('UNTESTED','NE',' ',$L,1) JUMP TO CHECK BAD: IF $LL IS NOT PRESENT THEN JUMP TO NONE TRANSFER ERROR 'UNTESTED INFORMATION NOT AVAILABLE' NONE: SET $SPY_MESSAGE = 'NO MORE UNTESTED STATEMENTS FOUND.'
WARNING macro
******************************************************* * SOFTSPY WARNING MACRO: * * * * DISPLAY A USER MESSAGE ON THE SOFTSPY MESSAGE LINE, * * PREFIXED WITH "WARNING: " * ******************************************************* * COMMAND 'SET $SPY_MESSAGE = ''WARNING: '' WITH ' WITH $MACRO_ARGS