Search    
 

   
 

 
PRAGMA PROGRAM REFERENCE MANUAL
Index
All Operation

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

Accepts input of a maximum number of designated characters from the keyboard
and writes it in a noun you designate. If 0 is specified as the maximum
length it accepts one key input from the keyboard without requirung a carriage
return, without showing it on the screen and without waiting for it.
512 is the maximum number of characters that may be specified as a layout.

INPUT LAYOUT using layout NUMBER into the noun NOUN

NUMBER is the maximum number of characters that can be entered before the
input terminates. Must be a positive integer less than 1969 or 0 for the
special case.

SEE ALSO: INPUT / INPUT KEY / INPUT STRING

DISCUSSION


INPUT LAYOUT accepts a maximum number of designated characters from the keyboard.

The maximum number of characters accepted is 512.

INPUT LAYOUT accepts: spaces, letters, digits, punctuation marks, special characters (for example , &, %), or a combination of these.

Every INPUT LAYOUT operation (as well as every INPUT, CUT, JOIN, or RECEIVE) writes a new value to the target noun LENGTH. To preserve the contents of LENGTH, copy it to another noun before using INPUT LAYOUT, INPUT, CUT, JOIN, or RECEIVE again.



The following editing keys are allowed:


INS Toggles insert mode on/off.
DEL Delete character above cursor and scroll characters.
BACKSPACE Deletes character to the left of the cursor and scrolls the
characters above and to the right of the cursor to the left
by 1.
LEFT ARROW Moves the cursor to the left by 1.
RIGHT ARROW Moves the cursor to the left by 1.
HOME Moves the cursor to the start of the value.
END Moves the cursor to 1 past the end of the value.
CTRL-LEFT Deletes everything to the left of the cursor and scrolls
characters above and to the right of the cursor left to the
home position.
CTRL-RIGHT Deletes everything to the right of the cursor.
ESC Restarts. Clears the current value and redisplays the
original value. The first character delete and replace
action is disabled.


will terminate the input.

The key is remappable and may be substituted by another key, thus freeing the key for other duties.



EXAMPLE

INPUT LAYOUT using layout 5 into the noun CUSTOMER NUMBER

Operator input, up to five characters long, is accepted and written into the noun CUSTOMER NUMBER.



INPUT LAYOUT 0

INPUT LAYOUT 0 is a special case of INPUT LAYOUT. It allows one key input without a terminating return. The input will not echo to the screen, nor will it wait for a key to be pressed. If no keyboard data is ready, the destination noun will receive a null value, and LENGTH will be 0.

Otherwise, the destination noun will receive the one character, and length will be 1. If an extended key is input, the noun will receive both bytes, and LENGTH will be 2. Extended keys are all the keys that do not display anything, such as the function keys and their ctrl and alt states.


In order to use INPUT 0 to input more than one character, you will have to use a loop. To test for a non alphanumeric key, you must compare the key against a value. There are actually hundreds of combinations like Crtl-Z, Alt-Q, etc. A utility in the on-line help lets you determine any key value.


If you use a loop, and no key is pressed, INPUT LAYOUT 0 puts a null value into the noun and a zero in LENGTH. In other words, the keyboard is continuously polled and the value that is read, even if it is zero, is copied to two nouns. This consumes a lot of CPU time and will slow down the whole system. INPUT LAYOUT 0 is best suited for cases when a single key MIGHT be pressed to interrupt a job or something similar. It is best used sparingly, and not in a tight loop. When the program DEMANDS a key to be pressed, like in a menu, it is better to use the standard verb INPUT KEY (INK).



EXAMPLE

VERB called EDIT

1 INPUT LAYOUT using layout 0 into the noun CHARACTER
2 IF the value CHARACTER "=" the value "__D" (F10 key)
3 do
SOME VERB
else
4 IF the value CHARACTER "=" the value "__?" (F5 key)
do
5 SOME OTHER VERB
else
end
end

6 etc...



 

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