Jump to the next field in the input screen statement. Once you have finished filling in a field, you must press the Tab key to jump to the next field.
The \ (backslash) can be used to return to a previous field. When the \ key is pressed, you will jump back to the beginning of the previous field and can change the entry.
The Return key is used to complete a data entry screen. If more than one format is included in a screen option, when you have finished filling in all the fields, the Return key must be pressed to complete data entry. You must be at the last field when the Return key is pressed. Until the Return key is pressed, you are free to change your response to any field.
10 a$ = '<AT 6, 10: Full name @@@@@@@@@@@@@@@@@@@@@@@@>' + & '<AT 8, 10: Address @@@@@@@@@@@@@@@@@@@@@@@@@@>' + & '<AT 10, 10: City @@@@@@@@@@@@>' + & '<AT 10, 38, AJ, REQ, LETTERS: State ^^>' + & '<AT 10, 50, REQ, DIGITS: Zip #####>' 20 CLEAR INPUT SCREEN a$: name$, addr1$, city$, state$, zip$ DELAY 30 CLEAR PRINT AT 6, 10: name$ PRINT AT 8, 10: addr1$ PRINT AT 10, 10: city$; ', '; state$; ' '; zip$ 40 END RNH Full name Sunny Day_______________ Address 2356 Main St._____________ City San Diego___ State CA Zip 92131 Press the RETURN key to continue Sunny Day 2356 Main St. San Diego, CA 92131
Use the MENU option to create pop-up menus.
[LINE] INPUT MENU str_expr: str_var
str_expr is a string expression that describes the menu. It consists of multiple, comma-separated elements. The elements can be either items or directives.
10 title$ = '%TITLE "structure",%MULTI,' box_loc$ = '%AT 10,15,' client$ = '"TTI_Client"={id,name={Cass,Brock,Errant},phone},' address$ = 'address={%BAR,street,city,state,country},' misc$ = 'misc={%REPLACE,mail,record}' menu$ = title$ & box_loc$ & client$ & address$ & misc$ 20 LINE INPUT MENU menu$: ans$ 30 END RNH +---STRUCTURE---+ | TTI_CLIENT +---ADDRESS--+ | ADDRESS |------------| | MISC... | STREET | +--------------| CITY | | STATE | | COUNTRY | +------------+
Menu items consist of either a description or a description and = sign followed by either a data value or a submenu indicator. If no = sign is given, the data value is the same as the description. If the description contains spaces or special characters, it must be enclosed within quotes.
Menu descriptions are displayed on the menu for the user to choose.
The data value is the value returned to the application when the menu item is chosen.
A submenu indicator consists of a "{" followed by menu elements followed by "}".
5.17.3 Menu DIRECTIVES:
The following directives can be used with the [LINE] INPUT MENU statement:
The menu or submenu box can be placed at a given row and column. CENTER can be used in place of row and/or column to center a menu or submenu.
%AT row, CENTER %AT CENTER, column %AT CENTER, CENTER
The %AUTODISPLAY directive controls display of submenus. Unless specifically turned OFF, INTOUCH automatically displays submenus.
FORMAT:
%AUTODISPLAY [ON|OFF]
The %AUTOVBAR directive is used to turn vertical bars ON and OFF in menus. By default, menubars do not have vertical bars separating the items. The %AUTOVBAR directive can be used to enable this feature, but it must be placed after the %MENUBAR directive.
FORMAT:
%AUTOVBAR [ON|OFF]
EXAMPLE:
10 item1$='%MENUBAR,%AUTOVBAR on,OPEN,SELECT={INCLUDE,EXCLUDE},SORT,PRINT' LINE INPUT MENU item1$ : ans$ END RNH +---------------------------------------------------------------------------+ | OPEN | SELECT | SORT | PRINT | +-----------+---SELECT---+--------------------------------------------------+ | INCLUDE | | EXCLUDE | +------------+
Separates DESCRIPTIVE-items with "----". The separated line consists of the characters specified in a "text_str". If no text is given, the separated line defaults to a dashed line.
FORMAT:
%BAR ['text_str']
EXAMPLE:
10 menu$ = '"DATA ENTRY","REPORTS",%BAR"*",MAIL,EXIT' LINE INPUT MENU menu$ : ans$ 20 END RNH +---------------+ | DATA ENTRY | | REPORTS | | ********** | | MAIL | | EXIT | +---------------+
The %COLUMNS directive sets the number of columns for the menu.
FORMAT:
%COLUMNS number
EXAMPLE:
10 menu$ = '%COLUMNS 3,"DATA ENTRY","REPORTS",MAIL,HELP,EXIT' LINE INPUT MENU menu$ : ans$ 20 END RNH +-------------------------------------+ | DATA ENTRY | HELP | EXIT | | REPORTS | MAIL | | +-------------------------------------+
The %HEADING directive displays a blank line and a "text_str" between menu items. If no "text_str" is given, the line defaults to a dashed line.
FORMAT:
%HEADING ['text_str']
EXAMPLE:
10 menu$ ='OPEN,SHOW,PRINT,%HEADING"GUIDE_OPTIONS",NOSYSTEM,"MENU ON|OFF"' LINE INPUT MENU menu$ : ans$ 20 END RNH +------------------+ | OPEN | | SHOW | | PRINT | | | | GUIDE_OPTIONS | | NOSYSTEM | | MENU ON|OFF | +------------------+
The %ITEMS directive creates a multi-column menu. "number" represents the number of items per column. %ITEMS creates as many columns as is necessary. Horizontal scroll the columns as needed.
FORMAT:
%ITEMS number
EXAMPLE:
10 menu$='ENGINES={%ITEMS 3, DBMS, RMS, ADABASE, RDB, DBASE}' INPUT MENU menu$: ans$ 20 END RNH +----------+------------------------+ | ENGINES | DBMS | RDB | +----------| RMS | DBASE | | ADABASE | | +------------------------+
The %LOCKSTEP directive controls column scrolling when there are multiple columns in one menu. If it is turned OFF, the columns scroll independently. Otherwise, the columns scroll together.
FORMAT:
%LOCKSTEP [ON|OFF]
EXAMPLE:
10 menu$ = '%LOCKSTEP off, %SIZE 4, 1,2,3,4,5,6,%SPLIT,7,8,9,10,11,12' LINE INPUT MENU menu$ : ans$ PRINT 'Please, PRESS the "NEXT" key' 20 END RNH Please, PRESS the 'NEXT' key +---------------+ | ... | 7 | | 4 | 8 | | 5 | 9 | | 6 | ... | +---------------+
The %MAXWIDTH directive controls the maximum width of the entire menu.
FORMAT:
%MAXWIDTH number
EXAMPLE:
10 menu$ = '%MAXWIDTH 20,%ITEMS 2,a,b,c,d,f,g,h,i,j' INPUT MENU menu$ : ans$ 20 END RNH +--------------------+ |<< F | H >>| | G | I | +--------------------+
The %MENUBAR directive creates menu bars (menus with choices listed horizontally) with pull-down submenus.
FORMAT:
%MENUBAR
EXAMPLE:
10 item1$='%MENUBAR,OPEN,SELECT={INCLUDE,EXCLUDE},SORT,PRINT' LINE INPUT MENU item1$ : ans$ 20 END RNH +---------------------------------------------------------------------------+ | OPEN SELECT SORT PRINT | +----------+---SELECT---+---------------------------------------------------+ | INCLUDE | | EXCLUDE | +------------+
The %MESSAGE directive displays a message when the menu or submenu is displayed.
FORMAT:
%MESSAGE 'message'
EXAMPLE:
10 CLEAR 20 menu$ = 'open,show,print, %MESSAGE "Select a menu option"' LINE INPUT MENU menu$: ans$ 30 END RNH +----------+ | OPEN | | SHOW | | PRINT | +----------+ Select a menu option
The %MULTI directive allows multiple items to be selected from a menu or submenu.
The %REPLACE directive can be located in any submenu. The calling menu is not kept on the screen. Pressing '\' will return to the calling menu.
Determines the number of DESCRIPTIVE-items that are located in the menu_box.
There is no limit to the number of the items that can be used. If all of the items do not fit within the menu box, the items are vertically scrolled using the UP, DOWN, NEXT and PREV keys. "Str_var" contains the name of the selected item. If the %MULTI directive is used and the Select key is pressed, "Str_var" contains the names of the items. Each item is separated by a linefeed character.
The %SPLIT directive instructs INTOUCH to start a new column at that specified point in the menu.
FORMAT:
%SPLIT
EXAMPLE:
10 item1$='title,chapter,page={1201,1202,1203,1204,%SPLIT,1305,1306,1307}' LINE INPUT MENU item1$ : ans$ 20 END RNH +------------+ | TITLE | | CHAPTER +-------PAGE---------+ | PAGE | 1201 | 1305 | +----------| 1202 | 1306 | | 1203 | 1307 | | 1204 | | +--------------------+
Assign a title to a menu or submenu.
The %VBAR directive is used to explicitly insert a vertical bar.
FORMAT:
%VBAR
EXAMPLE:
10 item1$='%MENUBAR,OPEN,%VBAR,SELECT={INCLUDE,EXCLUDE},SORT,PRINT' LINE INPUT MENU item1$ : ans$ END RNH +---------------------------------------------------------------------------+ | OPEN | SELECT SORT PRINT | +-----------+---SELECT---+--------------------------------------------------+ | INCLUDE | | EXCLUDE | +------------+
The %WIDTH directive controls the minimum width of the current column.
FORMAT:
%WIDTH number
EXAMPLE:
10 menu$ = '%WIDTH 20,%ITEMS 2,a,b,c,d,f,g,h,i,j' INPUT MENU menu$ : ans$ 20 END RNH +------------------------------------------------------------------------------+ |<< C | F | H >>| | D | G | I | +------------------------------------------------------------------------------+
The following is the user interface in a [LINE] INPUT MENU:
KEY INPUT [[#channel] [, PROMPT str_expr] [, TIMEOUT time_limit] [, ELAPSED num_var] :] var, [var,...]
10 PRINT 'See how quick you are.' 20 KEY INPUT PROMPT 'Press a key, quick!', & ELAPSED x: press$ 30 PRINT PRINT 'You took'; x; 'seconds to Press '; press$; '.' 40 END RNH See how quick you are. Press a key, quick! You took 1.99 seconds to Press h.
KEY INPUT inputs a keystroke from the user and stores the value of the key in the string variable specified.
Some applications require the use of special keys on the terminal or keystroke level validation. The KEY INPUT statement is used for these applications.
KEY INPUT does not echo the key pressed, nor does it generate a line feed.
All the options available with the preceding "INPUT" statement are also available with KEY INPUT. KEY INPUT returns the following:
_TERMINATOR returns control (Ctrl) characters in the format "CTRL/X". For example, if the user presses Ctrl/G, _TERMINATOR returns "CTRL/G".
10 KEY INPUT 'Press a terminator' : z$ PRINT PRINT 'You pressed '; _TERMINATOR 20 END RNH Press a terminator? (User presses CTRL/G) You pressed CTRL/G
The PRINT statement prints or displays text on the screen. The printed text can be formatted using a mask or directive and/or highlighted using video options. This section describes the various ways that text can be displayed on the screen.
PRINT [[AT row, col] [,ERASE] [,WIDE] [,BLINK] [,UNDERLINE] [,REVERSE] [,BOLD] [,USING "print_mask"]:] expr [{, | ;} expr...] [, | ;]
10 INPUT name$ PRINT 'Hello, '; name$ PRINT BOLD, UNDERLINE: 'Here is a number: 1.93' 20 END RNH ? Rick Hello, Rick Here is a number: 1.93
The simplest version of the PRINT statement is:
PRINT expr
expr is an expression to print. expr can be any INTOUCH expression. INTOUCH prints the value of the expression at the current cursor position and then generates a new line. A PRINT statement without an expression simply generates a new line.
The [?] can be used as a synonym for PRINT at the command prompt.
10 PRINT 'Line 1' PRINT PRINT 'Line 3' 20 END RNH Line 1 Line 3
One PRINT statement can print several items. Multiple items must be separated with a comma or a semicolon. The separator determines where the next expression will be printed.
You can use two additional features to position the cursor:
Separating print items with a [semicolon] causes the items to immediately follow one another. When the items are printed, no spaces appear between the expressions.
10 alpha$ = 'ABCDEFGHIJKLM' bet$ = 'NOPQRSTUVWXYZ' PRINT alpha$; bet$ 20 END RNH ABCDEFGHIJKLMNOPQRSTUVWXYZ
You can print in columns by using print zones. Each print zone has a default width of twenty characters. To change the width, see Section 9.17.2, SET ZONEWIDTH.
|-------------------|-------------------|-------------------| 1 20 40 60
Separating items with a comma causes the item following the comma to be printed in a new print zone. The terminal width determines the number of zones in each line. (See Section 9.8.1, ASK MARGIN statement to determine the terminal width.)
10 INPUT name_1$, name_2$ 20 PRINT name_1$, 'MARY', name_2$ 30 END RNH ? FRED, JOHN FRED MARY JOHN
If an item is longer than the zone width, INTOUCH continues it into the next print zone. INTOUCH uses as many print zones as necessary to print an item.
RNH ? FRED, DILLENSCHNEIDER & SONS FRED MARY DILLENSCHNEIDER & SONS
INTOUCH writes data sequentially. If an item is too long (over 132 characters) to write in one record, INTOUCH continues it in the next record.
10 OPEN #1: NAME 'test.tmp', ACCESS OUTPUT PRINT #1: REPEAT$('+-', 100) CLOSE #1 20 OPEN #1: NAME 'test.tmp', ACCESS INPUT LINE INPUT #1: record_1$, record_2$ PRINT 'Record 1: '; record_1$ PRINT 'Record 2: '; record_2$ CLOSE #1 30 END RNH Record 1: +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- Record 2: +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
The TAB function moves the print position to a specified column.
TAB(column)
column is the column position to print. TAB positions the cursor at the column specified. TAB always moves forward (to the right). If the cursor is at or past the column specified, INTOUCH jumps to the next line. The TAB function is a print item. Therefore, it must be separated from other print items with a comma or a semicolon.
10 INPUT name_1$, name_2$ 20 PRINT TAB(5); name_1$; TAB(20); 'MARY'; TAB(35); name_2$ 30 END RNH ? FRED, JOHN FRED MARY JOHN
The AT option moves the cursor to a specificed row and column on the screen.
AT row, column
row is the row to print at. column is the column to print at. Row and column can be any integer numeric constants.
10 INPUT name_1$, name_2$ 20 CLEAR 30 PRINT AT 3,10: name_1$; TAB(20); 'Mary'; TAB(35); name_2$ 40 END RNH ? Fred, John FRED MARY JOHN
The ERASE option erases from the end of the printed text to the end of the line.
10 CLEAR 20 PRINT AT 10, 1: 'Mary had a little lamb' DELAY 2 30 PRINT AT 10, 1: 'Jeff' DELAY 2 40 PRINT ERASE, AT 10, 1: 'Caroline' DELAY 2 50 END RNH Mary had a little lamb . . . Jeff had a little lamb . . . Caroline
This option prints double-width characters on the terminal screen.
10 PRINT WIDE: 'INTOUCH' 20 END
The following rules govern the printing of numbers:
10 LET x = 7 LET y = 10 PRINT x; y 20 END RNH 7 10
10 LET x = -7 LET y = -10 PRINT x; y 20 END RNH -7 -10
10 LET x = 700000000001 PRINT x 20 END RNH 700000000001
10 LET x = 700000000001.89 PRINT x 20 END RNH 700000000002
10 LET X = 70000000000001.89 PRINT X 20 END RNH .7E+14
INTOUCH prints: