Search    
 

   
 

 
PRAGMA PROGRAM REFERENCE MANUAL
Index
All Operation

Expand All      ADDENDUM
INPUT NUMBER INN Standard Verb Input/Output Operation
Target = LENGTH (LT)

Accepts number input from the keyboard and edits a noun whose value is expec-
ted to be a number or an expression convertible to a number. Certain keys are
allowed for editing, while any other control character will terminate the
input and its value stored into a specified noun.

LENGTH contains a count of the characters accepted.

INPUT NUMBER using layout NUMBER into the noun NOUN terminating key into the
noun NOUN2

NUMBER is the maximum number of characters that can be edited and must be a
number or a noun containing a number of not greater than 16. NOUN is the noun
to be edited. NOUN2 is the noun to receive the terminating control character.

SEE ALSO: INPUT / INPUT LAYOUT / INPUT STRING

DISCUSSION


Layout must be a number or a noun containing a number of 16 or less, since only 14 digits can by entered in any number (plus sign and decimal point). You can give it a higher number and you will be able to input more than 14 digits, but the result will be a string, not a number.

The layout has two parts: field width and decimal places. The maximum number of digits in a number is 14. Up to 13 may be on the right side of the point and the rest to the left. There is always at least one digit to the left of the point. The number of decimal places must be 13 or less. The whole number (field width) part must be at least 2 greater than the decimal (number of places) part of the layout to allow room for a leading zero and decimal point.

A numeric layout without any specified decimal places will disallow entry of decimal places.

A layout of 9.3 will give a total field width of 9 places with 3 decimal places.


The value of the noun to be edited is expected to be a number or an expression convertible to a number. If this is not the case, the "invalid number" message will be displayed and the job abandoned.

The value will be displayed starting from the current cursor position and according to the layout. Numbers will have no commas.

If a numeric value is larger than the layout specifies, the first digit will be a number sign (#). You may not edit this quantity (i.e., no editing keys will be allowed, only overtype mode will be available).

The cursor will be positioned to the ones digit of the number. If the first character typed is not an editing key, the entire field is cleared to spaces and you can type a new number.


The following editing keys are allowed:


BACKSPACE Deletes digit above the cursor and scrolls the digits to
the left of the cursor to the right by 1 if to the left of
the decimal, otherwise the decimal place digit to the left
of the cursor becomes a zero and the cursor moves to the
left by 1. If it gets to the tenth digit, it is
disallowed.
LEFT ARROW Moves the cursor to the left by 1.
RIGHT ARROW Moves the cursor to the left by 1.
CTRL-LEFT Turns the whole number part to zero and moves the cursor
to ones digit. Removes the minus sign.
CTRL-RIGHT Turns all decimal places to zero and moves the cursor to
the tenth digit if decimal places are specified, otherwise
it is disallowed.
ESC Restarts. Clears the current value and redisplays the
original value. The first number delete and replace
action is disabled.


Any other control character will terminate the input.

The underline key is not allowed. Any disallowed key generates a beep.

The cursor movement functions do not stop on the point, but skip over it. When a decimal point is entered, the cursor skips from the current position to the tenth digit, if decimal places are specified in the layout, or if no places are specified, it is a disallowed key . The minus key will cause a minus sign to be displayed before the leftmost digit if room exists within the field, otherwise it is a disallowed key. The plus key will remove this leading minus. The only other allowed keys are the digits. When a digit is entered to the left of the point, digits to the left of the cursor are scrolled left by 1, and the digit typed appears above the cursor. The cursor does not move.

Insert mode is essentially always enabled when it is to the left of the decimal. Digits entered to the right of the point overwrite the digit above the cursor and the cursor moves to the right by 1.

If this sounds cryptic to you, don't worry. It is much more difficult to explain than to do, so just try it out.


 

CustomWare® is a registered trademark of CustomWare Designs, Inc. All rights reserved.
CustomWare® is a registered servicemark of CustomWare Designs, Inc.  All rights reserved.
All images and designs on this web site are copyrighted© 2021.
v t