/FORM
... For space reasons, the original image
... has been omitted but it goes here.
/PAGE2 HELP
... For space reasons, the original help
... screen has been omitted but it goes here.
/PAGE3
... For space reasons, the original pop up
... question goes here but it has been omitted.
/*
// SET UP THE "POP UP" PAGE POSITIONS
PAGE SET SUPPORT AT 1 0
PAGE SET RUNEXT AT 13 0
// This program uses ENTERGROUP to modify
// the DataFlex error file.
// Create Synonyms for the above windows.
AUTOPAGE FORM
// Autopage has been set
// to start at form.1 and proceeds
// left to right, top to bottom.
NAME ERRNUM DESCR NOTE
NAME COMMENT ANS PRESSKEY
// Declaration of additional variables to be used
STRING TMPSTR
INDICATOR OLDREC // true if this is an old record
INDICATOR SAVEIT // true if this record should
be saved
INDICATOR FLXKEYS_ON // true if flex keys are
active
OPEN FLEXERRS
START:
// Initialize buffer and screen
CLEAR FLEXERRS
// Initialize to under scores
CLEARFORM ERRNUM THRU NOTE
// Initialize to blanks
BLANKFORM COMMENT THRU PRESSKEY
// Turn key.clear and key.delete on
INDICATE FLXKEYS_ON TRUE
ENTERGROUP
AUTOPAGE FORM
ENTRY FLEXERRS.RECNUM {AUTOFIND}
ENTRY FLEXERRS.ERROR_DESCR
ENTRY FLEXERRS.NOTE
// Turn key.clear and key.delete off
INDICATE FLXKEYS_ON FALSE
// Set [oldrec] true if old record
INDICATE OLDREC STATUS FLEXERRS
// Initialize [saveit] to true
INDICATE SAVEIT TRUE
// New record procedure
[NOT OLDREC] BEGIN
MOVE "This error does not exist. Do you wish to create a new one
(Y,N):" TO COMMENT
MOVE "Y" TO ANS
ACCEPT ANS {CAPSLOCK,CHECK="YN "}
// Does user really want to create new error?
INDICATE SAVEIT AS ANS EQ "Y"
END
REREAD
ENDGROUP
// Save error message
[SAVEIT] SAVE FLEXERRS
UNLOCK
// If new record, show the assigned error number
[NOT OLDREC SAVEIT] BEGIN
MOVE "Your new error message
has been assigned number: " TO TMPSTR
APPEND TMPSTR FLEXERRS.RECNUM
MOVE TMPSTR TO COMMENT
BLANKFORM ANS
MOVE "Please press <RETURN>
to continue" TO PRESSKEY
ACCEPT ANS
END
GOTO START
// Modify another error
KEYPROC KEY.HELP
// Activate help screen
HELP
ENTAGAIN
// Return to same window when complete
RETURN
KEYPROC KEY.ESCAPE
// Terminate program
ABORT
// The following key procedures are only
// active when the indicator[flxkeys_on] is
// true. This addition does allows the use
// of these keys when the user is in the
// entergroup macro.
KEYPROC KEY.CLEAR
// Start program again (it clears all)
[FLXKEYS_ON] RETURN START
// Otherwise, return to where we came from
ENTAGAIN
RETURN
KEYPROC KEY.DELETE
[FLXKEYS_ON] BEGIN
// Can only delete a valid error
IF NOT STATUS FLEXERRS ERROR 71
[NOT ERR] BEGIN
// Get current file status
REREAD
DELETE FLEXERRS
UNLOCK
END
// Modify another error
RETURN START
END
ENTAGAIN
RETURN
KEYPROC KEY.USER2 // DEFINE KEYPROC
ACCEPT RUNEXT.1 // POP THE QUESTION
CLEARSCREEN
IF RUNEXT.1 EQ '' SHOWLN 'TYPE "EXIT" TO RETURN TO DATAFLEX'
RUNPROGRAM WAIT RUNEXT.1
ENTAGAIN
RETURN // RETURN TO APPLICATION