INPUT USING

Function

INPUT USING obtains a line of data from HUNTER's keyboard and validates this data with a user defined mask.

Syntax

INPUT USING (validation string, [min, maxi) prompt string, variable name.

INPUT USING (validation string, [min, max, E]) variable name

where min, max are numeric expressions and E is a special command.

Examples

INPUT USING ("A999",2,4)S$

Causes ? prompt

A minimum of 2 characters must be entered up to a maximum of 4.

The inputs are stored in string expression S$. The first entry must be a letter in the range A-Z, the remaining entries must be numbers in the range 0-9.

INPUT USING ("A999",,4)S$

The same as above, but minimum defaults to 1.

INPUT USING ("A999",2,)S$

A minimum entry of 2 and maximum defaults to 95. Any entries after the fourth are validated against WILD.

INPUT USING ("A999")S$

Minimum and maximum default to 1 and 95 respectively.

INPUT USING (M$,3,6)S$

A minimum of 3 and up to a maximum of 6 entries are allowed. The entries are validated against the string expression M$. The user will receive a '?' prompt.

INPUT USING (M$,3,6)"ENTER",S$

Same as above, but with an 'ENTER' prompt.

INPUT USING (M$,3,6,E)"ENTER",S$

Same as above, but after the 6th character has been entered HUNTER will assume that the enter key has been pressed.

Remarks

Entry fields can be made numeric, alphanumeric, etc., in flexible configurations. Entries that do not fit the mask are rejected with a bleep.

INPUT USING is an extension of the standard INPUT statement. However, as each entry is made by the operator, the character is checked against the defined check string. A value which is out of range will cause an audible bleep to occur, rejecting the invalid entry.

The input validation string consists of defined validation characters either in the form of a string expression e.g. A$,B4$ etc., or a direct string enclosed in quotations. Input validation string may NOT be omitted.

The optional min and max expressions define the minimum number and maximum number of entries required. If neither min nor max are specified then default values of min 1 and max 95 are assumed. If maximum exceeds the number of characters in the input validation string, then the entries for which there are no validation characters are validated automatically with WILD card characters. If min=0 an input of 'CR* only is allowed.

The values min and max can be variables or arithmetic expressions. Min must not exceed max or a syntax error will occur. Min must not be negative or a magnitude error will occur. Min and max must not exceed 95 or a syntax error will occur.

’Enter’ terminates entry. ’ Enter’ will not be accepted if the number of characters is less than minimum.

When the number of characters exceeds maximum no more characters will be accepted. A warning tone will sound. The cursor right and cursor left are available in INPUT USING fields to edit or correct data prior to pressing 'ENTER’.

The E parameter is optional. If it is specified then the ’Enter' key does not have to be pressed to terminate the end of the characters allowed by the validation mask.

If the input field extends over more than one HUNTER screen line confusing results may occur in subsequent attempts to delete or edit characters.

To suppress the "?" prompt, a comma should follow the prompt string. There must be a prompt string when using comma, therefore, to have no prompt at all it is necessary to use the null string "".

A string, enclosed by quotes, immediately following the validation expression will cause that string to act as the prompt.

The cursor left and right keys are enabled in order to allow the user to modify incorrect entries by simply over-typing them. The delete key will delete the last character entered.

Validation Character Table

Charcter Description
A A-Z only
B A-Z space
C A-Z 0-9
D A-Z 0-9 space
N 0-9 ,
9 0-9 only
. Decimal point only
* Wildcard

Wildcard allows a character in the range of space - del which includes all letters and numbers.

Control characters are not accepted. Other characters than those in the table will give a Syntax error when the statement is RUN.