Comet 32 Runtime
|Syntax:||INPUT [(lun)] @(screen-position),variable-name[,length-override]
screen-position = the column and row (respectively) where an entry field will be created
variable-name = the name of the input variable
length-override = the size of the entry area (number of characters)
Note: If no lun is specified, the INPUT statement assumes lun 0.
This form of the INPUT statement creates a data entry field at
the specified screen-position. It differs from the
legacy INPUT statement in the following ways:
For example, suppose your program includes a string variable named A$ with a declared length of 10 bytes. The following statement creates a 10-byte entry field starting at column 20, row 12:
INPUT @(20,12),A$If you include a length-override parameter, and if the specified length is less than the declared field length, the input data will scroll horizontally if the cursor moves beyond the bounds of the field's entry area. (If the length-override is greater than the declared field length, the lenght-override is not used; the field size is determined by the declared length.)
INPUT @(20,12),A$,5In this case, the entry field will be 5 characters, even though the declared length of the field is 10 bytes.
Suppose your program includes a numeric variable named X with a declared length/precision of 8.3. The following statement creates a right-justified entry field starting at column 10, row 5:
INPUT @(10,5),XThe above entry field allows data entry up to 5 digits to the left of a decimal point and up to 3 digits to the right of a decimal point. The data entry space also permits a decimal point and minus sign, but no other characters.
Note: If an entry field is positioned on top of existing screen text, that text will appear inside the data entry space. This is a convenient way to add a default value to the INPUT statement.
When entering data into a multi-field INPUT statement, the user presses Tab to move from field to field, and presses Enter to transmit the data to the program. See Example 2.
See (Init Input Data) for information on how to display initial input values.
|History:||This form of the INPUT statement was added to Comet98 in Build 266.
The multi-field version, including the length override feature, was added in Comet98/Comet2000 Build 283.
This INPUT statement creates 7 entry fields. The first parameter on each line above is the screen location of where each entry field will occur. The second parameter is the field name, and the third parameter is the length override for the entry field.
The "tab order" is Addr1$, NumEmployees, State$, Adr2$, Zip$, City$, and AnnualSales.