SUBROUTINE PROGRAM.NAME
        COMMON definitions

SU (Setup) --------------------------->

In the setup area, where the system variables used by the PARADYME routine are initialized. This particular insert position is indicated by setting the Prompt Seq to 0.


        EQUATES
        OPEN FILES
        SETUP CURSOR POSITIONS
        CALL PD.BUILD.SCREEN( SCREEN.LAYOUT$, ...

ST (Start) --------------------------->

At the start of the program. This particular insert position is also indicated by setting the Prompt Seq to 0.


        PRINT SCREEN.LAYOUT$:

    * Main process control loop

ML (Main Loop) ----------------------->

Before entering the main process control loop. Again this position is indicated by setting Prompt Seq to 0. In conjunction with the above insert positions, it allows manipulation of the screen print.


        LOOP

MD (Main Driver) --------------------->

This is only really different from the ML code where the user inputs the key to the file in the generated routine. The outer loop drives the routine between records. The inner loop drives the routine between fields on the record. Thus, MD would be used to initialise variables prior to processing the next record. This particular position is also indicated by setting the Prompt Seq to 0.


            R.MAIN=NULL$ ; GOSUB 200
            PROMPT.NO$=1 ; FUNCTION$=NULL$
            LOOP

BF (Before Function) ----------------->

Where the user wishes to process a particular function key in a different way to the norm., an insert can be entered here. This position is indicated by a 0 for Prompt Seq. As it is outside the function handling case statement, the insert should be a self-contained statement block.


                BEGIN CASE
                    CASE FUNCTION$ = EXIT$ ...
                               : 
                               :
                END CASE
            UNTIL PROMPT.NO$ ........... 

FI (Finish) -------------------------->

This is used to insert code that will perform some function before exiting out of the subroutine. Again this is indicated by a 0 for Prompt Seq.


        RETURN
    100*
        CALL PD.INPUT( ........
        IF FUNCTION$ = 'REPRINT' THEN ........
        RETURN
    200*

PS (Print Start) --------------------->

Where the user wishes to modify the main print routine BEFORE any of the standard routine has been processed. This may include modification or setting up of variables which will subsequently be printed. This position is indicated by a 0 for Prompt Seq.


        MASK="R#4" ; PRINT ...... 
        GOSUB 410

PR (Print return) ------------------->

This insert can be used where the user wishes to add functionality to the print routine just before control leaves the routine itself. This functionality could be either printing data that cannot be specified in PARADYME or carrying out some processing. It is inserted AFTER the other display fields have been processed. This position is indicated by a 0 for Prompt Seq.

ALL the above prompt positions MUST have a 0 for Prompt Seq. In addition they MUST all be inserts defined in the SINGLE VALUES definition screen.


        RETURN
    300*
        FOR POS.INDEX$ = 1 TO 6 
            PRINT .............. 
        NEXT POS.INDEX
        RETURN
   400*

PB (Print Begin) --------------------->

Where the user wishes to modify the window print routine BEFORE the FOR/NEXT routine has been encountered, they would use this insert code. This may include modification or setting up of variables which will subsequently be printed. This position is indicated by a 0 for Prompt Seq when entered in the Multi-value definition screen.


        FOR CINDEX$=0 TO 2
            VMC.DISPLAY$= .............. 
            MASK$=............. 

PS (Print Start) --------------->

This allows for processing to be added to at the start of each line of the window display. By entering the code here, the processing is carried out on before any other items are displayed thereby allowing the user to set up the values that will subsequently be printed. This position is indicated by a 0 for Prompt Seq when entered in the Multi-value definition screen.


            READ R.XREF FROM F.XREF,R.MAIN<KEY.AMC>
                R.XREF=NULL$
            END

PA (Print After Read) ---------->

There are instances where the user sets up a cross reference and wish to set a value in the display that is dependant on the contents of the cross referenced record. This value may only be arrived at by carrying out some processing. This processing can be inserted using the code PA. Note that this insert is put in ONLY ONCE. It is ONLY inserted after the first file read that is generated for the specified print routine.


            MASK$=............. 

PN (Print Next) --------------->

This allows for processing to be added to at the end of each line of the window display. By entering the code here, the processing is carried out after all the PARADYME defined items are displayed. This could be extra display data that cannot be dealt with by PARADYME or some totalling required on the data displayed. Note that if the user does display data, the must setup their own display line. This position is indicated by a 0 for Prompt Seq when entered in the Multi-value definition screen.


        NEXT CINDEX$

PR (Print Return) -------------->

Where the user wishes to add functionality to the print routine, this insert position can be used. This position is indicated by a 0 for Prompt Seq when entered in the Multi-value definition screen.

This differs from the PN code in that the processing occurs only once for each call to this routine and then only after the data has already been displayed.

It also differs from the previous PR position, as does the PS insert, in that this must be entered in the MULTI-VALUED prompt definition for which the print routine is set up. If it was the first window, the insert would be put in routine 400, the second would go in routine 410, etc.


    500*
        LINE.FUNCTION$= ............
        BEGIN CASE
            CASE FUNCTION$ = ....... 
                    : 
                    : 
        END CASE
        RETURN
    1000*

ST (Start) --------------------------->

Inserted before any code for the single valued prompt is executed


        CONVERSION$=NULL$ ; CURSOR.INDEX$=..........

BI (Before Input) -------------------->

After the input parameters have been set up but before input loop entered.


        LOOP
            VALUE$ = R.RECORD<FIELD> ; GOSUB 100..... 

BR (Before Read) --------------------->

If a cross file validation has been specified then insert before the read is performed.


            IF FUNCTION$ = NULL$ THEN
                READ R.RECORD FROM F.RECORD,....
                           :               
                END
            END

AI (After Input) --------------------->

Straight after input but before validation (If cross file validation then after read)


            BEGIN CASE

BF (Before Function) ----------------->

Inserted before any function validation.


                CASE FUNCTION$ = INVERT$

IS (Insert Start) -------------------->

Insert any code before the call to the table file lookup routine is made.


                    CALL PD.SSELECT( R.INV.PARAM$...
                                :
                    PRINT SCREEN.LAYOUT$: ; ..

IF (Insert Finish) ------------------->

Insert code after the the table file lookup has been completed but before processing continues in the PARADYME routine.


                CASE FUNCTION$ NE NULL$

AF (After Function) ------------------>

After function validation but before validation of value input.


                CASE NONE.OF.ABOVE$

AV (After Validation) ---------------->

Inserted where accepted value is processed.


                    VALID.INPUT$=TRUE$ ; .... 

AU (After Update) ------------------->

Inserted after the current input held in VALUE$ has been written back to the dynamic array/variable, but before any associated data displays are done.

EN (End None of Above) -------------->

Inserted after all the processing in the "CASE NONE.OF.ABOVE$ condition has been processed


            END CASE
        UNTIL VALID.INPUT$ DO REPEAT

FI (Finish of routine) ----------->

This allows the user carry out processing after the input has been dealt with but before control returns to the main driver routine.


        RETURN

AR (After Routine) --------------->

i.e. Subroutines.

ALL the preceding insert codes are positions within a standard routine generated for a prompt. The actual routine and hence position where the code is to be inserted is determined by the Prompt Seq number linked to that insert.


    2000*

ST (Start) --------------------------->

This is inserted at the start of the window driver routine. It must have a 0 entered for Prompt Seq and is defined in the multi- value definition screen for which the driver is generated.


        VMC$=1 ; ............
        END.OF.WINDOW$=FALSE$ ; .......
        IF VMC.DISPLAY............
        LOOP
            BKFUNC$=................. 
                      : 
                      : 
            ON VMC.PROMPT.NO$ GOSUB 2100

BF (Before Function) ----------------->

This is inserted before the case statement that handles the function keys. It may be used to override normal function processing. Again this is indicated by a 0 Prompt Seq and is defined in the multi-value definition screen for which the driver is generated.


            NEXT.PAGE.VALUE$=............ 
            GOSUB 500 
            ..........: 
            ..........: 
        UNTIL END.OF.WINDOW$ DO REPEAT

FI (Finish) -------------------------->

This is inserted at the end of the driver routine for the window. Position defined as for BF above. It is used to perform any processing on data after the user has quit from the given window.


        RETURN

AR (After Routine) ------------------->

This is inserted after all the window driver processing code, but before any of the window field input routines. It must have a 0 entered for Prompt Seq and is defined in the multi-value definition screen for which the driver is generated.


    2010*

The following insert positions are much the same as for 1000* above. Insert positions are defined in Multi-value definition screen for the particular window and refer to the Prompt Seq of the input variable in that window. Due to the similarities, only the differences will be detailed in this section.

ST (Start) --------------------------->


        CONVERSION$=NULL$ ; CURSOR.INDEX$=..........

BI (Before Input) -------------------->


        LOOP
            VALUE$ = R.RECORD<FIELD,VMC$> ; GOSUB 100

BR (Before Read) --------------------->


            IF FUNCTION$ = NULL$ THEN
                READ R.RECORD FROM F.RECORD,....
            END

AI (After Input) --------------------->


            BEGIN CASE

BF (Before Function) ----------------->


                CASE FUNCTION$ = INS$

IN (Insert line function ) ----------->

When the user inserts a blank line into a window, there may be some processing required to reset certain variables. This processing can put in using the 'IN' code.

Note that the IS and IF inserts are valid here as well. For an explanation of these, see above.


                CASE FUNCTION$ NE NULL$
                CASE VALUE$ = NULL$

DL (Delete line in window ) ---------->

When the user deletes a line from a window, some processing may be required on certain variables, for instance to recalculate totals after one of the values has been removed. This processing can be inserted into the routine by using the 'DL' code.


                    R.MAIN=DELETE(R.MAIN,.......

DE (DElete in window) ---------->

This allows for processing to be added at the end of the associate value deletion as generated by PARADYME. This comes after all the values to be deleted have been deleted. It may be used to add extra deletion or generate new sub-totals. Note that it comes just before the call to redisplayed the modified window data.


                    GOSUB 4n0
                CASE NOT( RECORD.ON.FILE$ ) AND ..
                    PRINT EPOS$:REV.ON$:........

AF (After Function) ------------------>


                CASE NONE.OF.ABOVE$

AV (After Validation) ---------------->


                    VALID.INPUT$=TRUE$ ; ....

AU (After Update) ------------------->

EN (End None of Above) -------------->

The difference between the insert codes AU and EN is that the with AU, the code is inserted after the data input is transfered to the buffer record but before the logic to display any associated non-input fields is generated. With EN, the insert is placed AFTER the associated non-input fields.


            END CASE
        UNTIL VALID.INPUT$ DO REPEAT

FI (Finish of routine) ----------->


        RETURN

AR (After Routine) ------------------->


    3000*

SK (Start of OK (Y/N) routine) --->

This is at the start of the OK prompt routine. It requires a Prompt seq of 0 and needs to be defined in the Single value definition screen.


        CONVERSION$="YN" ; .............. 
                  :
                  :

LK (Loop in OK) ---------------------->

This has been specifically setup to modify the system variable PROMPT.TEXT$. The value of this variable is displayed next to the OK input position and prompts the user for input.


        LOOP
            PRINT ............ 
            VALUE$=NULL$ ; ...........
            BEGIN CASE

FK (Function case in OK routine) ----->

This would be the first case test in the routine that deals with the input to the OK prompt. It is defined as for SK above. The insert takes the form of CASE statements.


                CASE FUNCTION$ = "ERROR" ; NULL
                    : 
                CASE NONE.OF.ABOVE$ 

OK (OK to continue process) ------>

This is where the processing takes place once all the updates to the record have been OKayed. Again it is defined in the same way as for SK above.


        RETURN

AR (After routine) --------------->

Any code that is not tied into the program can be inserted here. Again it is defined as for SK above.


        END