@ [Remove all lines preceeded by a "@"] @ [Conditionally remove all lines preceeded by a "^"] @ 10 %TITLE " - " %IDENT "X00.00" %SBTTL "Overall description" ! ! ENVIRONMENT SPECIFICATION: ! OPTION & TYPE = EXPLICIT, & SIZE = INTEGER LONG, & SIZE = REAL DOUBLE, & SCALE = 4 REM ------------------------------------------------------------------ A PRIMARY PROGRAM PART OF THE SYSTEM DEVELOPED BY AND FOR C A R L ' S G R O C E R Y C O M P A N Y , I N C . COPYRIGHT (C) 19XX BY CARL'S GROCERY COMPANY, INC. This software is the sole property of Carl's Grocery Company, Inc., and is intended soley for its use. It may not be copied. ----------------------------------------------------------------- FACILITY: @ Give a brief description of the system or library facility. ABSTRACT: @ Include here, a short 3-6 line abstract of the program. AUTHOR : CREATION DATE:
20 %PAGE %SBTTL "Environment" ! ! ENVIRONMENT: ! ! VAX-11 user mode ! VARIANT ASSUMPTIONS: ! NONE ! ! INTERACTIVE MODE FOR THIS PROGRAM: ! ! Operating modes for this program are as follows %LET %YES = -1 %LET %NO = 0 ! Normal terminal I/O mode is primarily for batch operations ! (This mode is set to no if any other mode is set to yes) %LET %NORMAL = [%YES][%NO] ! TDMS mode, screen mode is preferred for interactive operations %LET %TDMS = [%YES][%NO] ! Utility (command type) mode is preferred for simple interaction %LET %UTILITY = [%YES][%NO] REM PRIVILEGE, PROTECTION AND PRIORITY @ Include here, any special privilege, protection or priority @ considerations. (Note that the default exit mode is established @ in this template under process initialization.) 30 %PAGE %SBTTL "Modification history" REM MODIFICATION AND DEVELOPMENT HISTORY VER# P.EXT DATE CODER NATURE OF CHANGE ------ ----- ------ ----- ---------------- 31! X00.00 <++> Creation date @ [++ If upgrade is by patch, include patch extension <.ext>] 489! 490 %PAGE %SBTTL "Full description" REM FUNCTIONAL DESCRIPTION: @ A detailed functional description of the program goes here. This @ should detail the steps of the process, the use of external @ functions and subprograms (including system services, RTL routines, @ SYSLIB routines which are additional to template standard), and @ so forth. IMPLICIT INPUTS: @ Describe sources of information used by the program. IMPLICIT OUTPUTS: @ Describe any output produced by this program. SIDE EFFECTS: @ Describe all functional side effects that are not evident from @ the invocation interface. This includes changes in storage al- @ location, process status, file operations (including the command @ terminal), errors signalled, etc., which are additional to @ template standard. ^ COMMAND SYNTAX (IF UTILITY MODE): ^ @ Describe the syntax this program expects and how the command @ line is parsed, making reference to any help files. ^ TDMS REQUESTS (IF TDMS MODE): ^ ^ NAME DESCRIPTION ^ @ REQUEST_NAME @ Briefly describe what the request does, the form @ it uses, the file and any other pertinent information. 500 %PAGE %SBTTL "Declarations" ! ! DATATYPE SPECIFICATION: ! ^ RECORD ! @ ^ END RECORD ! ! INITIALIZING INCLUDE FILES: ! ^ %INCLUDE "" ! @ ^ ! ! EQUATED SYMBOLS: ! ! Set up constants for program identification DECLARE STRING CONSTANT & PROGRAM_ID = "", & PROGRAM_NAME = "" ! Set up constants for relational tests DECLARE INTEGER CONSTANT ! to test for true or false & NO = 0, & YES = NOT NO DECLARE BYTE CONSTANT ! to test entry and exit & ACTIVATED = 1, ! flags as on or active & FAILURE = -1, ! flags as operation failure & NORMAL = 0 ! normal entry or exit & ! Set up channel assignments DECLARE BYTE CONSTANT & @ = "1"B, ! & @ . . . . . . . @ . . . . . . . @ . . . . . . . ^ DECLARE CONSTANT & ^ = , ! & ^ = ! ^ ! ! LOCAL STORAGE: ! ! Set up entry and exit flags DECLARE & BYTE & Batch_process ! flags batch & ! Standard work variables DECLARE ! declare work variables & INTEGER & Work_integer, ! variable of default integer & ! type & REAL & Work_real, ! real number variable of & ! default precision & STRING & Work_string ! dynamic string variable ^ DECLARE & @ & @ , ! & @ , ! & @ & @ , ! & @ ! ! ! GLOBAL STORAGE: ! ^ COMMON () ! & @ & @ , ! & @ , ! & @ & @ , ! & @ ! ^ MAP () ! & @ & @ , ! & @ , ! & @ & @ , ! & @ ! ! ! EXTERNAL REFERENCES: ! ^ EXTERNAL CONSTANT & @ ! ^ EXTERNAL & @ ! %IF %UTILITY = %YES %THEN ! Define CLI functions EXTERNAL INTEGER FUNCTION & CLI$PRESENT ! function determing operation EXTERNAL INTEGER FUNCTION & CLI$GET_VALUE ! retrieves the value/param %ELSE %END %IF ^ EXTERNAL FUNCTION & @ ! & @ ( BY , ! & @ BY ! ^ EXTERNAL SUB & @ ! & @ ( BY , ! & @ BY ! ! ! INTERNAL REFERENCES: ! ^ DECLARE FUNCTION & @ ! & @ (, ! & @ ) ! 989 %PAGE %SBTTL "Begin process initialization" REM oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo PROCESS INITIALIZATION oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo Lines 990 - 998 contain process initialization sections. 990 %PAGE %SBTTL "Process initialization" !+ ! Set up global error handler and default entry/exit !- ON ERROR GOTO Master_error_handler @ [Alternately, local error handlers are to be set up for each program @ module and/or wherever else they are needed] !+ ! Calls to initializing subroutines !- GOSUB Device_file_read ! read device file GOSUB Security_routines ! security check %IF %NORMAL = %YES %THEN !+ ! BOJ message !- PRINT PRINT '--BOJ-- '; PROGRAM_ID; ' '; PROGRAM_NAME; TAB(60); & DATE$(0); ' '; TIME$(0) PRINT %ELSE %END %IF %IF %TDMS = %YES %THEN ! Declare and activate TDMS %INCLUDE "SYD:[SYSLIB.TEMPLATES]INCTDMS.PLT" %END %IF 999 %PAGE %SBTTL "Begin main processing" REM oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo BEGIN PROCESSING oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo Lines 1000 - 7999 contain primary processes. Lines 8000 - 8997 contain program wrap up and exit control. 1000 %PAGE %SBTTL "Process control - program root module" @ [Main code goes here] 8000 %PAGE %SBTTL "Process termination - wrap up and exit" 8900 ! ! EXIT ! %IF %TDMS = %YES %THEN !+ ! Shut down TDMS !- ! Close request library Ret_status = TSS$CLOSE_RLB (Library_ID) GOSUB TDMS_return_status_check ! Close operator channel Ret_status = TSS$CLOSE (Channel_no, CLEAR_SCREEN) GOSUB TDMS_return_status_check %ELSE %END %IF ! [NOTE: All channels should be closed by this point.] %IF %NORMAL = %YES %THEN PRINT PRINT "--EOJ-- "; PROGRAM_ID; " "; TIME$(0) PRINT %ELSE %END %IF 8998 ! Exit program GOTO Program_end 8999 %PAGE %SBTTL "Begin local support routines" REM oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo BEGIN LOCAL SUPPORT ROUTINES oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo Lines 9000 - 9999 contain system standard subroutines, the first of which is the device file read (line 9000). Lines 10000 - 24997 contain program specific subroutines. 9000 %PAGE %SBTTL "Internal routine: Device_file_read" %INCLUDE "Filespec" ! include the device file read @ @ 24990 ! Include TDMS status check routine if TDMS application %IF %TDMS = %YES %THEN %INCLUDE "PLTS:INCTDMSCK.PLT" %ELSE %END %IF 24998 PRINT "Program has fallen through support routine section" STOP 24999 %PAGE %SBTTL "Begin local functions" REM oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo BEGIN LOCAL FUNCTIONS oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo Lines 25000 - 29997 contain local program functions. 29998 PRINT "Program has fallen through local function section" STOP 29999 %PAGE %SBTTL "Begin directed entry and exit" REM oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo BEGIN DIRECTED ENTRY AND EXIT oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo Lines 30000 - 30499 contain any entry control and verification process for chain entry and utility mode programs. Lines 30500 - 30997 contain chain exit processing. 30999 %PAGE %SBTTL "Begin common error handling" REM oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo BEGIN COMMON ERROR HANDLING oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo Lines 31000 - 31997 contain common error handling routines, the first of which is the control C handler. 31000 %PAGE %SBTTL "Error handling routines" Master_error_handler: SELECT ERR CASE ELSE ! Return control to system error handler ON ERROR GOTO 0 END SELECT 31998 PRINT "Program has fallen through common error handling section" STOP 31999 %PAGE %SBTTL "Begin security section" REM oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo BEGIN SECURITY SECTION oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo Lines 32000 - 32765 contain any security handling routines. 32000 %PAGE %SBTTL "Internal routine: Security_routines" Security_routines: @ [Include or insert at this point any standard security routines to be @ performed and delete the following comment and return.] @ ^ ! No secruity routines are included for this program ^ ^ RETURN 32765 PRINT "Program has fallen through security section" STOP 32766 %PAGE %SBTTL "Program end" REM oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo PROGRAM END oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo 32767! Program_end: END