광고
광고
INPUT FORM
INPU
T FORM
IPF
IPF
IF_name [
NO
DISPLAY]
IF_name [
AL
AY
[
NC
]
LN
[
NC
]
NC
]
directs INFO to define a new screen entry form or to run an existing screen form.
arguments
IF_name the name of the INFO input form file.
[NODISPLAY] used during form definition to suppress display of the input form grid during the definition dialog.
AL (Automatic Leave) suppresses the IS THIS RECORD
ACCEPTABLE? prompt and automatically accepts the record, but does not clear the screen at the end of the record. It returns to the ENTER COMMAND > prompt.
AY (Automatic Yes) suppresses the IS THIS RECORD
ACCEPTABLE? prompt, assumes a response of Y and clears the screen after each record is entered unless the
NC option is included.
You cannot use the AY option when the first entry of an input form is defined as an F (forced field) item.
LN displays the IS THIS RECORD ACCEPTABLE?
prompt and waits for a response of L or N (leave or not accept). If you enter a Y (yes) or <RETURN>, INFO assumes a response of L. If you enter a Q (quit), INFO displays an error message and reissues the prompt.
NC (No Clear) does not clear the screen after each record is entered, regardless of the response to the message IS
THIS RECORD ACCEPTABLE?. If you are executing a multiple-screen input form, INFO displays the first screen of the form after each record is entered.
INFO Reference Manual Commands 287
INPUT FORM notes
n
Before defining or executing an input form, be sure to take the following steps: n
Format the system variables, $CHRn, $DATn and $NUMn, to correspond to their use in the form. See the FORMAT command discussion for instructions.
n
Select and relate all applicable data files in the order in which they will be selected when the form is executed.
n
Use the TERMINAL command to notify INFO of your computer's screen hardware configuration. See the
TERMINAL command for information about changing terminal types.
The following system control variables allow input forms to be customized :
$IPF-DISPLAY When set to 1, causes INFO to display the contents of the buffers for the second and subsequent records added, based on the first or preceding record. In an even-numbered program section (i.e. equivalent to a
UPF command) it displays the current buffer contents for the current record.
$RETRY Enables you to change the maximum error count that INFO will allow before asking 'DO YOU WANT
TO TRY AGAIN ?'. Do not set $RETRY to 0, as you will be prompted before each field. Default = 6.
$IPF-COMMAND Allows you to test which command invoked the input form. $IPF-COMMAND is a read-only variable which is set by INFO during the execution of an input form to the command used :
'INPU' = IPF
'UPDA' = UPDATE ... with IPF
'UPFO' = UPF (or equivalent even-section IPF).
$IPF-PROMPT User-definable end of input form prompt to replace :
'IS THIS RECORD ACCEPTABLE (Y,N,Q,L OR E)>.
288 Commands INFO Reference Manual
INPUT FORM
$IPF-YES Single character alternative to the 'Y' response.
$IPF-NO Single character alternative to the 'N' response.
$IPF-QUIT Single character alternative to the 'Q' response.
$IPF-LEAVE Single character alternative to the 'L' response.
$IPF-EXIT Single character alternative to the 'E' response.
$IPF-ANSWER Set by INFO to the corresponding answer to the end of form prompt. 1 = Yes, 2 = No, 3 = Quit,
4 = Leave, 5 = Exit.
$IPF-NC When set by INFO to 1 implies that the NC option was used.
$IPF-LN When set by INFO to 1 implies that the LN option was used.
$IPF-AY-AL When set by INFO to 1 implies that the AY or AL options were used.
$IPF-QUIT-ON-LOCK If set by the user, upon detection of a record lock on a related file, INFO will quit the input form.
$IPF-QUIT-MESSAGE Can contain a user-defined message to be displayed upon a QUIT-ON-LOCK condition.
Accept Attribute Settings can be set for IPF fields and cursor-addressed ACCEPT statements. The system item
$DISPLAY-MODE should first be set to 1, then the following system items can be used:
$ACC-ATTRIBUTE Any string used to set attibutes, such as reverse video, on ACCEPT. INFO has its own set of system items containing the ANSI escape sequences for such attributes, eg. $REVERSE.
$ACCEPT-FILL Set to 1, will cause INFO to display
ACCEPT-FILL-CHAR across the accept field rather than the field contents.
$ACCEPT-FILL-CHAR Any character to be displayed across the accept field width.
INFO Reference Manual Commands 289
INPUT FORM
$LEFT-DELIMITER Any character used as a left delimiter for an accept field. Displayed at row,col - 1.
$RIGHT-DELIMITER Any character used as a right delimiter for an accept field. Displayed at row,col + 1.
$DELIM-ATTRIBUTE Any attribute to be associated with the delimiter characters.
examples
FORMAT $NUM1,6,I
DISPLAY-MODE = 1
$ACC-ATTRIBUTE = $REVERSE
$ACCEPT-FILL = 1
$ACCEPT-FILL-CHAR = '.'
$LEFT-DELIMITER = ='['
$RIGHT-DELIMITER = =']'
$DELIM-ATTRIBUTE = $BOLD
IPF ENHANCED.IPF
discussion
Display Attribute Settings can be set for IPF fields and cursor-addressed DISPLAY statements. The system item
$DISPLAY-MODE should first be set to 1, then the following system items can be used:
$DISP-ATTRIBUTE Any string used to set attibutes, such as reverse video, on. INFO has its own set of system items containing the ANSI escape sequences for such attributes, eg. $REVERSE. Items or variables will be displayed with this attribute.
$MESS-ATTRIBUTE Works as $DISP-ATTRIBUTE for default and user-defined error messages (Input Form format only).
$RESET-ATTRIBUTE Should be set to the system default display attribute setting when using $DISPLAY-
MODE = 1. Screen output will then return to 'normal' upon returning to interactive use from an INFO program. For example, $RESET-ATTRIBUTE = $NORMAL.
An input form is a combination of literal and data fields.
Once defined, it allows fast and accurate data entry.
290 Commands INFO Reference Manual
INPUT FORM
Input form supports the following validation:
R - Range checking
V - Default value
L - List check
M - Match related item
K - Duplicate key check
A - Auto duplicate
F - Forced field
Most INFO commands which are valid in program even sections may be used in input forms in program-style statements, and it is possible to mix and match input form and program-style commands, using the strengths of each.
For instance, the MATCH, LIST and KEY input for subcommands do in one line of coding what would take several lines in a program. On the other hand, programstyle conditional testing via IF...ELSE...ENDIF and branching via GOTO and LABEL can be a lot easier to code and maintain than the input form BRANCH option with its PASS/FAIL options.
It is also possible to insert commands in input forms, as in programs, for ease of maintenance.
INFO Reference Manual Commands 291
INPUT FORM
Defining a new form
To initiate an input form definition dialog, enter the command INPUT FORM with the name of the new form.
INFO brings up a grid on your terminal screen to help you design your input form.
ENTER COMMAND >SELECT D.EMPS
0 RECORD(S) SELECTED
ENTER COMMAND >INPUT FORM I.EMPS
1---5---10---15---20---25--//--45---50---55---60---65---70---75---80
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+---+----+----+----+----+--//---+----+----+----+----+----+----+----+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+---+----+----+----+----+--//---+----+----+----+----+----+----+----+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+---+----+----+----+----+--//---+----+----+----+----+----+----+----+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+---+----+----+----+----+--//---+----+----+----+----+----+----+----+
LINE,COLUMN,CONTENT>
To suppress the grid display, include the NO DISPLAY option on the INPUT FORM command.
292 Commands INFO Reference Manual
INPUT FORM
Defining an input form field
You can define your INPUT FORM fields in any order.
However, INFO processes each field in the defined order at execution. Therefore, it is good practice to define the input form prompts before the input fields to which they refer and to define both going left to right, top to bottom on your screen.
For each field definition, INFO prompts:
LINE,COLUMN,CONTENT>
Enter a response in the following format: line[,] column,content[,sub-commands[,MESS [text]]]
Value
Zero (0)
1 to 24
Line and column identify the position at which the content is displayed or entered on the screen. Line and column can be expressed as a literal, an item name, or a system variable.
Line defines the horizontal line on which the content is displayed using any of the following values:
Description
Clears the screen and positions the cursor to line 1, column 1 at execution. Use this
specification to define a second or subsequent screen format for a multiple-screen input form.
If column also equals 0, INFO starts a new screen and displays the screen grid again. If column is greater than 0, INFO starts a new screen but does not display the screen grid.
Identifies the specified line. 1 corresponds to the top-most line on the screen, and 24 corresponds to the last usable line at the bottom of the screen. Many CRT screens scroll if you try to accept or display information on line 24.
INFO Reference Manual Commands 293
INPUT FORM
Column defines the vertical position on the line where the content is displayed. It can be any value from 1 to the maximum screen width for the terminal in use: 1 corresponds to the left-most position on the screen; the maximum width corresponds to the right-most position on the screen.
INFO displays messages during input form processing on the line corresponding to the value of $ERROR-
POSITION, columns 1—50. The input form processor uses lines 21—23 for prompts and messages. If you define fields for these locations, they may be overwritten on the definition grid, although this will not affect the execution of the form.
Content is the information to be located at the specified line and column. Content can be a literal, an arithmetic expression, or an item.
A 'literal' appears on your screen exactly as entered.
Specify a literal by enclosing it in single quotes
(apostrophe). To embed an apostrophe within the text, use two successive quotes (for example, 'YESTERDAY''S
PRICE').
An 'arithmetic expression' evaluates a value that is displayed on the screen at runtime. See 'Building
Expressions' in the Introduction for a complete discussion of the rules for constructing a valid expression.
An 'item' is a data item, system item, or system variable.
You can use any data item from a currently selected file or related file. INFO either displays or accepts the item, depending on the subcommands you include in the field definition.
The sub-commands control data validation and display, and provide logical branching capability during the execution of an input form. Table IPF-1, at the end of the
INPUT FORM discussion, describes the various subcommands.
294 Commands INFO Reference Manual
INPUT FORM
MESS [text] is used only when a data validation subcommand is provided for the field. MESS allows you to override standard INFO data validation error messages with user-defined messages. Text can be any combination of items and literals. If the data entered for the associated content fails to meet the specified data validation criteria,
INFO displays the specified message text. To suppress any message display when a data validation error occurs, include MESS without text.
In the following example, the input form I.EMPS is being defined. The command lines used to create the form are listed below.
1---5---10---15---20--//--45---50---55---60---65---70---75---80
+ + + + + + + + + + + + +
+ + + + NEW EMPLOYEE FORM + + + + + +
+ + + + + + + + + + + + +
+LAST NAME:+-------+-//-+---+----DATE HIRED:---+----+----+----+
+FIRST NAME: ............... + + + + + + +
+ + + + + + + + + + + + +
+JOB TITLE:.................... + SALARY: $....... + +
+ + + + + DEDUCTIONS: .. + + + +
+---+----+----+----+-//-----+---+----+----+----+----+----+----+
+ADDRESS:+ .................... + SSN: ......... + + +
+ADDRESS:+ .................... + + + + + + +
+ + + + + + + + + + + + + +
+PHONE NO.: .......+ + + + + + + + +
+---+----+----+----+--//---+----+----+----+----+----+----+----+
+ + + + + + + + + + + + +
+ + + + + + + + + + + + +
+ + + + + + + + + + + + +
+ + + + + + + + + + + + +
+---+----+----+----+--//---+----+----+----+----+----+----+----+
INFO Reference Manual Commands 295
INPUT FORM
OK?>
LINE,COLUMN,CONTENT>
3,17,'NEW EMPLOYEE FORM'
5,1,'LAST NAME:'
5,51,'DATE HIRED:'
6,2,'FIRST NAME:'
8,2,'JOB TITLE:'
8,55,'SALARY: $'
9,51,'DEDUCTIONS:'
11,1,'ADDRESS:'
11,55,'SSN:'
12,1,'ADDRESS:'
14,1,'PHONE NO.:'
5,13,L.NAME,F
5,62,DATE.HIRED,V,$TODAY
6,13,F.NAME
8,13,TITLE
8,64,PAY,R,750,2200
9,63,NO.DEDS,R,1,5
11,13,ADDRESS.1
11,60,SSN,K
12,13,ADDRESS.2
14,13,HOME.NO
Create form title.
Create form prompts.
Forced entry Value.
$TODAY is default value.
Range checking.
Checks for unique value.
296 Commands INFO Reference Manual
INPUT FORM
Each time you enter a text literal, such as the title line of this input form, INFO displays the literal at the location specified and prompts OK?>. If you respond Y (yes) or
<RETURN>, INFO accepts the literal and prompts for the next line. N (no) causes INFO to remove the literal from the grid and prompts you to re-enter the line.
When you define a data field such as 5,22,L.NAME,F,
INFO fills the specified screen location with periods for the correct output width and prompts for verification, as described above.
To end the definition dialog, enter a <RETURN> after any
LINE,COLUMN,CONTENT> prompt. A <RETURN> after the first such prompt causes INFO to return immediately to
ENTER COMMAND >. When you end the dialog, INFO prompts:
DO YOU WISH TO EXECUTE THIS FORM (Y OR N)>
Respond with Y (yes) or <RETURN> to clear the screen definition grid and begin executing the form. An N (no) response will store the input form for future execution and return you to ENTER COMMAND >.
Use the EDIT or CHANGE command to make corrections or changes to a finished input form.
INFO Reference Manual Commands 297
INPUT FORM
Logical branching
A variation of the field-definition syntax defines logical branching within your input form processing.
To define PASS/FAIL branching for a field, use the following syntax: line[,]col,content[,B],sub-command,... [PASS | FAIL label_name]
To label a target field, use the following syntax: line[,]column,content,sub-command[,] ..LABEL label_name
When processing the field at runtime, INFO evaluates the data for the item according to the subcommands provided, then uses the criteria described below to determine a true or false condition. You can include any subcommand described in Table IPF-1 at the end of this discussion in a field definition that uses the PASS or FAIL specification.
The logical branching subcommands B, PASS and FAIL instruct INFO as follows:
B directs INFO not to accept the data being tested. You might use B specification, for example, to test a date and branch according to its value, even though the date is not included in the record built by the input form.
PASS instructs INFO to branch to the corresponding label if the result of the evaluation is true. If the evaluation is false, INFO passes control to the next line. Label_name is the 1- to 16-character name of a label defined using the
LABEL command.
FAIL instructs INFO to branch to the corresponding label if the result of the evaluation is false. If the evaluation is true, INFO passes control to the next line. Label_name is the 1- to 16-character name of a label defined using the
LABEL command.
Label_name is from 1 to 16 characters long and must be unique within the input form definition. You can include up to 100 labels in an input form. Including the LABEL subcommand at the end of an item definition does not affect execution of the line at runtime.
298 Commands INFO Reference Manual
Executing an existing form
Response
Y
(Yes)
INPUT FORM
If PASS is included in a field definition that does not accept data or contains the A, D, S, or V subcommands
(subcommands that cannot be evaluated as true or false),
INFO branches unconditionally to the labeled field. If you specify FAIL for such a field, INFO ignores the FAIL and transfers control immediately to the next line.
It is also possible to use the INFO program command
IF...ELSE...ENDIF for logical branching.
You can execute an input form by entering an INPUT
FORM command followed by the name of the input form and any appropriate runtime options.
INFO processes each line in the input form in the order in which it was defined. When it encounters a display field,
INFO displays that value. When it encounters an input field, INFO positions the cursor at the defined location and waits for you to enter a value.
Each time you enter an input value, INFO checks the validity of the value, then checks the data against any verification subcommands specified for the item. If an error occurs, INFO displays an appropriate error message and repositions the cursor so you can re-enter the data over the invalid entry. INFO does not store a record until the entire form has been processed.
When INFO encounters the end of the form, it prompts:
IS THIS RECORD ACCEPTABLE (Y,N,Q,L OR E)> unless you specified an AY or AL option. Enter one of the following responses to this prompt:
Description
Instructs INFO to accept the record and store it in the selected data file. Unless you specify the
NC subcommand on the IPF command, INFO clears the screen before processing the next record. INFO assumes a Yes if you respond
<RETURN> or include the AY subcommand in the INPUT FORM command.
INFO Reference Manual Commands 299
INPUT FORM
(cont'd)
Response
N
(No)
Q
(Quit)
L
(Leave)
E
(Exit)
Description
If you want to correct errors in the record, enter an N to direct INFO to reprocess the record.
INFO repositions the cursor at the first input field and waits for new data. Overwrite fields to correct them. To keep correct values, enter an equal sign (=) or the current TAB character.
See 'Screen initialization and data entry' below for information about the use of control characters in IPF processing.
If you are executing a multiple-screen form,
INFO redisplays the first screen of the form and repositions to the first input field on that screen.
INFO does not accept the data and clears the screen unless the NC subcommand is specified on the IPF command. INFO repositions the cursor at the first input field and waits for you to enter a new record.
Specifies that the record is acceptable and should be stored, but instructs INFO to terminate form processing without clearing the screen. If you include the AL option when executing the form, INFO assumes this response.
Alternatively, the runtime LN option directs
INFO to assume this response if you enter a Y
(yes) or <RETURN>. Typically, you will use this option when the form is executing from within a program, to enter one record at a time and leave the formatted screen for the next record.
Instructs INFO to accept the record, terminate the form processing and clear the screen.
Terminate INPUT FORM processing as follows:
If the first field in the form is not defined with the F or V subcommand, enter a <RETURN> to the first request for input in any record.
300 Commands INFO Reference Manual
INPUT FORM
(cont'd)
Response
Screen initialization and data entry
Description
Respond E (Exit) or L (Leave) to the IS THIS RECORD
ACCEPTABLE ? prompt after entering data for the last record you want to add. If the first field in the form is a forced field, you must use the E or L response to terminate form processing.
You cannot include the AY option when executing a form whose first field is a forced field or default value field, because those subcommands suppress the display of the
IS THIS RECORD ACCEPTABLE prompt.
In an interactive session or odd-numbered program section, before accepting any input values for a new record, INFO initializes all items in the record buffer to blanks or zeros, depending on the data type. Initialization does not take place between successive records. If the form is executed in an even-numbered program section, it is not initialized.
When INFO processes an input field, it positions the cursor at the defined location for the item and waits for input. Respond as follows:
To enter a value for an item, enter the value followed by a
<RETURN> (unless ARET is Y and field is filled).
To enter a null value to an item, enter <SPACE>
<RETURN> for the first item and <RETURN> for any other items.
To preserve an item value from the previous record, enter an equal sign (=) or the TAB character and press
<RETURN>
To skip all fields remaining on an input form, preserving the value for each field from the previous record, enter the
<KEEP> character at any point. INFO stops processing the current record immediately and displays the IS THIS
RECORD ACCEPTABLE ? prompt, leaving the remaining items in the form unchecked.
INFO Reference Manual Commands 301
INPUT FORM
To abort the form with the remaining fields set to blank or zero, enter the <CLEAR> character at any point. INFO ends form processing immediately, initializes all remaining fields as null values, and displays the IS THIS RECORD
ACCEPTABLE ? prompt. If you respond with the <KEEP> or <CLEAR> character for the first field in the form, INFO ends form processing immediately, but does not display the IS THIS RECORD ACCEPTABLE? prompt. INFO returns to the ENTER COMMAND > prompt.
To return to a previously entered field, enter the
BACKTAB character (\). You can use this response to change a value previously entered for a field. If you tab back to a previous screen while executing a multiplescreen form, INFO redisplays that previous screen.
See the CCHR command for more information about the
<KEEP>, <CLEAR>, <TAB> and <BACKTAB> settings.
Using related files
INFO repositions a related data file during input form execution under these conditions:
The value of the item by which the file is related changes
Any portion of an accepted item overlaps the relate key item
Be careful to avoid changing the value of the relate key item on either the selected or previous related file until you finish processing all other related data items. This allows
INFO to accept new values for items other than the relate key item in a related record, then modify and rewrite the record before repositioning the data file.
Programming considerations with INPUT
FORM
When you execute an input form in an odd-numbered program section, it is most efficient to leave the prompts on the screen between records. Do this by defining two forms, one comprising the displayed prompts and the other the data items to be entered, and instruct
INFO to clear only the data-item screen. Specifically, use the AL subcommand with the first (prompt) screen, and use the NC subcommand with the second (data-item) screen.
302 Commands INFO Reference Manual
example
INPUT FORM
In an even-numbered program section, INPUT FORM processing only modifies the current record. It does not create new records or clear the screen before processing the form.
The following listing of an input form illustrates the use of some of the input form subcommands. You may list the contents of an input form file with the TYPE command.
3,30,'O.I.C., INC.'
5,20,'WEEKLY PAYROLL UPDATES'
.
.
.
10,10,'REG. HOURS:'
10,25,$1REG-HRS
10,25,$1REG-HRS,B,R,0,40,PASS SKIP
If $1REG-HOURS is in the range of 0 to 40, branch to the line labeled SKIP.
Otherwise, go to the next line.
10,25,$1REG-HRS,D
1,1,$1OT-HRS,S,$1REG-HRS — 40
Calculate and store overtime hours.
1,1,$1REG-HRS,S,40
13,10,'OT HOURS:'
13,25,$1OT-HRS,D
Display the hours calculated above.
15,10,'GROSS PAY:',LABEL SKIP
If $REG-HRS is less than 40 and greater than 0, skip to here.
15,30,'$'
1,1,$1GROSS,S,( $1REG-HRS * $1HRLY-RATE ) + ( $1OT-HRS *
( $1HRLY-RATE * 1.5 ) )
Calculate and store $GROSS-
PAY.
1,1,$1YTD-GROSS,S,$1YTD-GROSS + $1GROSS
15,31,$1GROSS,D
Display $1GROSS-PAY
INFO Reference Manual Commands 303
INPUT FORM
Table IPF-1 INPUT FORM definition subcommands
Subcommand Description
A
(Auto- Duplicate)
B
(Branch)
For input fields only. INFO requests a value for the item only for the first record in an INPUT
FORM session and duplicates the value automatically for each subsequent record.
Auto-duplicate is useful, for example, if the same batch number is entered for each record in a group.
Auto-duplicate should not be used for items in a related data file, in even-numbered program sections, or with the K subcommand (described below).
When used with another data validation subcommand and with the PASS or FAIL subcommand, processing can branch to the input form statement labeled label_name based on whether or not the validation passed or failed.
line[,]column,content,B,subcommand,<PASS/FAIL> label_name
D
(Display)
The field is displayed, not accepted as input.
This is the default subcommand for literal and arithmetic expression content. INFO displays the field according to the output width of the field. You can override the width and decimal position specifications by entering them explicitly as part of the subcommand specification using the following subcommand format:
D,width,decimal_positions
304 Commands INFO Reference Manual
INPUT FORM
Table IPF-1 INPUT FORM definition subcommands (cont’d)
Subcommand Description
D
(Display) cont’d
F
(Forced Field)
In the following example, INFO subtracts the value in AMOUNT from that in BALANCE-DUE and displays the result on the screen, starting at line 10, column 25, with an output width of
14 and 2 decimal positions:
10,25,BALANCE-DUE – AMOUNT,D,14,2
D is the default subcommand for calculated fields. Therefore, the example above can also be specified as:
10,25,BALANCE-DUE – AMOUNT,14,2
For date items, you must include a display length followed by a 'D' for the decimal positions. Otherwise, INFO displays the result as the number of days since 1/1/1801. In the following example, today's date is displayed in 8-position date format (the century is omitted).
5,15,$TODAY,D,8,D
With the F subcommand, you must enter a value. If you forget, INFO displays an error message and waits for you to enter a value for the field.
If you specify the F subcommand for the first field in a form, you cannot execute the form using the AY subcommand.
INFO Reference Manual Commands 305
INPUT FORM
Table IPF-1 INPUT FORM definition subcommands (cont’d)
Subcommand Description
K*
(Key)
The value entered into this field must be unique. INFO verifies this by sequentially searching the selected records. If INFO finds a record with the same value, it displays the following message:
ITEM ALREADY EXISTS
KO*
(Key ordered)
INFO waits for you to enter a correct value. In the following example, the value entered for
EMP-ID-NO must be unique.
4,15,EMP-ID-NO,K
This subcommand cannot be specified in conjunction with the A subcommand.
The value entered must be unique (see the K subcommand). INFO assumes the selected records are in ascending order by the item name and performs a binary, instead of sequential, search of the selected records to make sure that the value entered is unique.
*You can combine any one Key subcommand
(K, KO, NK, NKO) with any one Match subcommand (Mn, MnS, NMn, NMnS).
Any records added during an INPUT FORM session are maintained separately and searched sequentially, even when the KO subcommand is specified. At the end of input form processing, INFO appends the new records to the selected data file and selects them. The appended records must be merged into the sorted selected records before they can be processed again using an input form with the KO subcommand.
306 Commands INFO Reference Manual
INPUT FORM
Table IPF-1 INPUT FORM definition subcommands (cont’d)
Subcommand Description
L
(List)
The value entered must be in the specified list.
The list can contain up to 10 items including system items, system variables, numbers, or dates, and up to 20 literals enclosed in single quotes. You can include a total of 20 C-type items and literals combined in the same list.
Separate the values in the list with a single comma or the current delimiter. Terminate the list by entering two successive delimiters or a
<RETURN>. INFO rejects an invalid entry with the message:
INPUT VALUE NOT AN ELEMENT OF SPECIFIED LIST
M#*
(Match)
After displaying the error message, INFO repositions the cursor at the field location and waits for you to enter a new value over the invalid entry.
In the following example, the value entered for
CHAR-FIELD must be A, B, C, or D.
5,7,CHAR-FIELD, L,'A','B','C','D'
This subcommand cannot be used in conjunction with the R, NR, or NL subcommands.
The value entered for the field is accepted only if the specified item has a matching value in a related data file. Enter this subcommand in the following format: line[,] column,content,M#[,item_name]
*You can combine any one Key subcommand
(K, KO, NK, NKO) with any one Match subcommand (Mn, MnS, NMn, NMnS).
INFO Reference Manual Commands 307
INPUT FORM
Table IPF-1 INPUT FORM definition subcommands (cont’d)
Subcommand Description
M#*
(Match)
(cont'd) where # indicates the data file relation number.
(For example, M2 indicates that the item must have a match in the second related data file.)
Since the default value is 1, you can specify M1 as M. The item_name is the item that INFO uses to process a match operation. Do not include the $# prefix with the item name.
If INFO fails to locate a matching record, it displays the following message and waits for you to enter another value.
NO MATCH IN RELATED FILE # FOR RECORD nnnnnnnn
M#S*
(Match sequential)
In the following example, ACCT-NO is defined as a six-digit numeric field with the first two digits redefined as SUB-CODE. The selected file is related to another file on the common item, SUB-CODE.
7,2,ACCT-NO,M,SUB-CODE
The statement above directs INFO to accept the value for ACCT-NO only if the first two digits entered, the SUB-CODE, match a value in the related data file.
The value entered for the field is accepted only if the item specified is in the selected file and has a match in a related data file.
Operates exactly as the M# subcommand, described above, but forces a sequential search of the related file. Use M#S to force a sequential search on data files related with the
ORDERED or SEQUENTIAL options.
308 Commands INFO Reference Manual
INPUT FORM
Table IPF-1 INPUT FORM definition subcommands (cont’d)
Subcommand Description
NL
(Not in List)
NK* and NKO*
(Not a Key and
Not a Key Ordered)
NM#* and NM#S*
(No Match and
No Match Sequential)
NR
(Not in Range)
The field value cannot be a value in the specified list. Operates like the L subcommand except that you can only enter values that are not on the specified list. See the L subcommand for information about how to specify this subcommand.
You cannot use this subcommand in conjunction with the L, R or NR subcommand.
*You can combine any one Key subcommand
(K, KO, NK, NKO) with any one Match subcommand (M#, M#S, NM#, NM#S).
The field value must already exist. INFO verifies that the value exists by searching the selected records.
NKO indicates that the records are sorted in ascending order by the key item so that INFO can perform a binary search on the records rather than a less efficient sequential search.
These subcommands are the logical opposites to the M# and M#S subcommands They ensure that the value entered for a field does not have a match in the related data file.
The value entered for this item must not fall within a specified range. The range identifies illegal values for the item. Range limits are inclusive. An invalid entry for the item displays an error message.
After displaying the error message, INFO blanks the input field, repositions the cursor at the field location and waits for you to enter a new value.
This subcommand cannot be used in conjunction with the R, L or NL subcommands.
INFO Reference Manual Commands 309
INPUT FORM
Table IPF-1 INPUT FORM definition subcommands (cont’d)
Subcommand Description
R
(Range)
The value entered for this field must fall within the specified range. Format the R (or NR) subcommand as follows:
R,low_value,high_value where low_value and high_value can be data file items, system items, system variables, literals, numbers, or dates. Both values must be compatible with the field defined. The range limits are inclusive.
When comparing items of different lengths,
INFO uses the length of the shorter item, ignoring the excess characters of the other item.
INFO rejects a value outside the specified range and displays one of the following messages:
BELOW MINIMUM VALUE OF RANGE or
ABOVE MAXIMUM VALUE OF RANGE
After displaying the error message, INFO blanks out the input field, repositions the cursor at the field location and waits for you to enter a new value.
In the following example, the value entered for
DATE-HIRED must be greater than or equal to
1/1/1980 and less than or equal to today's date.
6,23,DATE-HIRED,R,1/1/1980,$TODAY
This subcommand cannot be specified with the
NR or NL subcommands.
310 Commands INFO Reference Manual
INPUT FORM
Table IPF-1 INPUT FORM definition subcommands (cont’d)
Subcommand Description
S
(Store)
The field is the destination for a MOVE or
CALCULATE operation, implied by the type of the item specified, but is not displayed on the screen. Use the following format for the S subcommand:
S,source_item
The source_item can be a literal, arithmetic expression, or item, as described above for content. The content and source item must be compatible data types. For example, if the field content is a C-type item, you must specify another C-type item or a literal for source_item.
If source_item is an arithmetic expression,
INFO evaluates the expression and stores the result in the content item. Truncation and blank padding occur when appropriate. You must specify a legal screen position, even though it is not used. The same screen position can be used in another field that displays or accepts data.
When you use the BACKTAB character to return to a previous field, INFO executes each field that it encounters. For example, if the source_item for a particular field is an arithmetic expression that contains a system item whose value has changed since it was first stored, back-tabbing through the field causes
INFO to recalculate the arithmetic expression and store the new result, which might differ from the earlier result.
Note that the Store subcommand can cause a repositioning of any data file related on the item modified. Depending on the RELATE option in effect, new records can be written to a related data file from Store subcommand processing.
INFO Reference Manual Commands 311
INPUT FORM
Table IPF-1 INPUT FORM definition subcommands (cont’d)
Subcommand Description
S
(Store)
(cont’d)
The following examples illustrate the use of the
S subcommand:
SC
(Store Conditionally)
12,23,NEW-FLAG,S,'*'
Moves an asterisk to item NEW-FLAG. If NEW-FLAG is wider than one character, the item is right- padded with blanks.
20,1,$IDX2,S$IDX2 + 3 Increments $IDX2 by
3 and stores it back in $IDX2. This is a common technique used to accept input to elements of an array.
The field is the destination for a MOVE or
CALCULATE operation, implied by the type of the item specified that is not displayed on the screen. Operates as the S (Store) subcommand, except that INFO saves the original value of the field before storing the entered value. If you respond Q or N to the IS
THIS RECORD ACCEPTABLE prompt during form execution, INFO restores the original value of the field before processing the Q or N response. If you respond Y, L, or E to the IS
THIS RECORD ACCEPTABLE prompt, INFO stores the entered value.
312 Commands INFO Reference Manual
INPUT FORM
Table IPF-1 INPUT FORM definition subcommands (cont’d)
Subcommand Description
V
(Value)
see also
For input fields only. The stored value defaults to the specified value if the user enters a
<RETURN>. Format the V subcommand as follows:
V,default_value where default_value is the name of another data file item, system item, system variable, or literal. The following example requests that
INFO supply the value 'UPS' for SHIP-VIA whenever a <RETURN> is entered during execution:
9,1,SHIP-VIA,V,'UPS'
The V subcommand cannot be specified in conjunction with the F subcommand.
UPF
UPDATE
INFO Reference Manual Commands 313
다운로드
광고