You are here: Development Standards > Routines > General Routines > GENINPUT.PUB

# GENINPUT.PUB

GENINPUT.PUB is a public program for performing data entry. The interface routine GENINPUT should always be used to access GENINPUT.PUB.

`0500 ENTER Z9$,Y$,ROW,COL,COM_COL,TYPE,LEN,FORCE,MASK$,X,X$,INFO,WINDID$,`
`0500:SELVAL$,COMPID$,PROGID$,FILE[ALL],YDISABLE$,HLP_ID$,FLD_HLP$,GENINPUT$`

Variable | Parameter | Description
Z9$ | Z9$ | Alternate field highlight. Set to brackets for terminals with no reverse video. Cleared for all other terminals.
Y$ | Y$ | Last command—set to new command on exit
ROW | (X0) | Row for data input
COL | (X1) | Column for data input
COM_COL | (X2) | Page reference for help
TYPE | (X3) | Type of input: 0 - string 1 - numeric 2 - string with a mask 3 - string forced to uppercase 5 - yes/no or choice field entry 6 - date field entry 7 - string (cursor at end of field) 9 - other commands (one uppercase character) 10 - period entry 11 - year entry 12 - period/year entry 13 - GL account number entry. GL Account is validated as active. 15 - toggled input (use capitals in X1$ for toggles) 17 - uppercase only string (cursor at end of field) 21 - period input (blank entry is allowed) 22 - year input (blank entry is allowed) 23 - period/year entry (blank entry is allowed) 24 - URL entry (Shift-F3 launches browser) 25 - email address (Shift-F3 launches email client) 26 - file browser dialog box (BBj only) 27 - directory browser dialog box (BBj only) 28 - file browser with path in STBL(“BBJFILEPATH”) (BBj only) 29 - GL account number entry. GL Account is not validated. -8 - other commands (traps edit and function keys) -9 - other commands (traps edit keys also)
LEN | (X4) | Length of input field
FORCE | X9 | Forced entry flag: 0 - begin with default value in X or X$ 1 - clear X or X$ before data entry X9 is set to 0 upon exit
MASK$ | X1$(1) | Entry and display mask
X | X | Numeric default value AND return value
X$ | X$ | String default value AND return value
INFO | INFO | Information window status flag as defined in GENINPUT
WINDID$ | WINDID$ | Inquiry window ID as defined in GENINPUT
SELVAL$ | SELVAL$ | Inquiry selection value as defined in GENINPUT
COMPID$ | COMPID$ | Not currently used in GENINPUT.PUB
PROGID$ | PROGID$ | File maintenance program as defined in GENINPUT
FILE[ALL] | FILE[ALL] | Standard file array for inquiry and file maintenance
YDISABLE$ | YDISABLE$ | See the definition of YDISABLE$ for GENINPUT
HLP_ID$ | PGM(-2) | The help ID for the program, usually the program name
FLD_HLP$ | FLD_HLP$ | Help ID of common-field help screen
GENINPUT$ | GENINPUT$ | Template used for miscellaneous functions

Exit Point | Explanation
EXIT | GENINPUT.PUB normally exits with no error.
EXIT ERR | An error is returned if an error occurred.
EXIT 127 | An ESCAPE is returned if Ctrl+A is pressed in debug mode. Debug mode is toggled with an ESCAPE (Ctrl+Break on PCs).

The GENINPUT$ template can be set by calling the SETUP_TEMPLATE label. This chart breaks down the GENINPUT$ template:

Field | Description
DRILL:N(1*) | Set to 1 if drill-down is available. Used by GENLINE.PUB and GENGULIN.PUB
COL:N(2*) | Set to column user clicked on from a GUI grid. Used by drill-down.
ROW:N(2*) | Set to row user clicked on from a GUI grid. Used by drill-down.
RPTDFLT:N(1*) | Set to 1 if a report default(s) is available.
CONTROLID:N(5*) | Not Used
TAG:C(1) | Set by calling program if the current F2 inquiry window is a taggable HLE
LIST:C(1*) | Contains list of tagged keys. Passed in and out of GENWIND.PUB so tagged list is displayed and returned properly.
DISPLEN:C(1*) | Set by calling program on a text wrapping field. X4 is maximum length, while GENINPUT.DISPLEN is the maximum length to display on the screen.
APP:C(2*) | Used for period locking functionality. Contains appliation to check for a period lock. Used by period entry types.
RMPL:N(2*) | Channel RMPLx file is opened on.
RMPH:N(2*) | Channel RMPHx file is opened on.
CLIENT:N(1*) | Set to '1' if a GUI file open dialog box is to be preformed on the client workstation.
PASSWD:N(1*) | Set to 1 if current entry field is a password entry.
RTNCLICK:N(1*) | Set to 1 if GUI GENGUINP.PUB should return on each field click.

GENINPUT.PUB performs these functions:

- determines if a command character has been entered
- accepts the command sequence and returns the standard command
- processes the Esc and displays a command help window (GENINPUT.HLP)
- returns all other command characters to the CALLing program
- calls the Inquiry Window routine when requested if WINDID$ has value
- calls the Help routine when requested
- calls the Maintenance routine when requested if PROGID$ has value
- allows Insert mode to be toggled on/off
- allows Quick mode to be toggled on/off
- allows verification to be toggled on/off
- allows the bell to be toggled on/off
- allows copying and pasting of data to and from fields
- displays online documentation
- validates periods and years for period/year entry
- displays Maint, Inquiry, Insert, Verify, Quick, Info and Company ID flags
- has an interface to run other commands or programs
- accepts user input a single character at a time
- automatic error trapping when using X3=5 or X3=6
- warns the user with a beep when he enters an invalid character
- warns the user with a beep when he types too many characters
- restores the original data when the user presses the UNDO key
- performs debug functions as described below
- sets WINDID$ and SELVAL$ to nulls upon exiting

Multiple fields in the same function can share the same help record by setting the variable X2 to indicate the values of X0, X1 and X2 in the help file. The format is X2=(X0*10000)+(X1*100)+X2. Multiple fields in the same application can share the same help records by setting the variable FLD_HLP$ with the help ID for the shared screen.

The user can toggle debug mode by pressing Ctrl+Break (Ctrl+C with Open Windows). In debug mode the user can enter additional commands that perform debugging functions. These three functions are available in debug mode:

- Control+A (break), exits and returns an error 127 to the calling program.
- Control+S, dump to screen, performs the DUMP verb to the screen.
- Control+P, dump to printer, performs the DUMP verb to the LP printer.