Please enable JavaScript to view this site.

ESL Documentation

A match clause can indicate that a number must appear in the input.  A number is identified by the keyword number in a match clause.  A number is an integer, consisting of any digits, optionally preceded by a sign (+ or -) or leading blanks, and without embedded commas or decimal points.

(Note that floating point values cannot be taken.)  For example:

 

response to char        col 11 number from        Prog

 

specifies that position 11 must contain an integer.  Because there is no ending position in this match clause, it is satisfied by a number of any length.

In the match clause for the following response statement:

 

response to char        col 11  thru 16 number from        Prog

 

there must be a number in positions 11 through 16, beginning in position 11.  The number can have leading blanks or a sign, but no other characters may precede the number.  Any of the following, beginning in column 11, satisfy this match clause:

 

12

  12

12X

These character strings do not satisfy this match clause:

 

X12

- M123

 

Characters that match a number specification must contain at least one digit.  For example, the following:

 

- 42

 

in columns 1 through 4 does not satisfy a response statement with a match clause such as the one below:

 

response to char        col 1 thru 2 number from        Prog

 

ESL finds only the minus sign and leading blank ("- ") in columns 1 and 2.  Although these characters can be part of a valid number, they do not, by themselves, satisfy a match clause that specifies a number.

Embedded blanks, commas, and decimal points are not allowed in numbers.  For example, the number:

.35

in column positions 3 through 5 does not satisfy a response statement with a match clause such as the following:

 

response to char        col 3 thru 5 number from        Prog

 

However, this match clause is satisfied if the number:

 

123.5

 

begins in column 3, because "123" is a valid number.