12. Number input function ~~~~~~~~~~~~~~~~~~~~~ This is a similar sort of Function for validating numbers which may be more than just a single digit. If the number entered doesn't fall within the required limits, the incorrect entry is erased ready for another try. If you are only interested in integers, then alter the variables figure, min and max by adding a "%" sign on the end. Wierd things happen if you muck about with the cursor editing keys, but you can easily temporarily disable them with *FX4,1 or *FX4,2. Like the previous Function, it really pays off in larger programs, as it saves you having to write separate validation routines for each and every input. You could save the Function with the *SPOOL facility, and *EXEC it into new programs as required. Again, you can omit spaces if you want. 10 CLS:PRINTTAB(7,10)"Enter Width ";:width=FNnumber(18.2,65.7) 20 END 100 DEFFNnumber(min,max):LOCAL P%,V%,figure 110 P%=POS:V%=VPOS:PRINT:REPEAT REPEAT VDU127:UNTIL POS=P% AND VPOS=V%:INPUT""figure:UNTIL figure>=min AND figure<=max: =figure