M!INTOUCH® 4GL Y

INTOUCH® 4GL
A Guide to the INTOUCH Language

A
Previous page... 6Table of Contents




EJump to the next field in the input screen statement. Once you have Kfinished filling in a field, you must press the Tab key to jump to the next field. 

\





4The \ (backslash) can be used to return to a Fprevious field. When the \ key is pressed, you will jump back to the :beginning of the previous field and can change the entry. 



Return





LThe Return key is used to complete a data entry screen. If more Gthan one format is included in a screen option, when you have finished Hfilling in all the fields, the Return key must be pressed to Ncomplete data entry. You must be at the last field when the ReturnMkey is pressed. Until the Return key is pressed, you are free to #change your response to any field. 

P        10  a$ = '<AT 6, 10: Full name @@@@@@@@@@@@@@@@@@@@@@@@>' + & P                 '<AT 8, 10: Address @@@@@@@@@@@@@@@@@@@@@@@@@@>' + & @                 '<AT 10, 10: City @@@@@@@@@@@@>' + & I                 '<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  0             Full name Sunny Day_______________  0             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 

4

5.17 MENU Option



3Use the MENU option to create pop-up menus. 

FORMAT:



,        [LINE] INPUT MENU str_expr: str_var 


Dstr_expr is a string expression that describes the menu. It Lconsists of multiple, comma-separated elements. The elements can be either items or directives. 



EXAMPLE:



2        10  title$ = '%TITLE "structure",%MULTI,' $            box_loc$ = '%AT 10,15,' J            client$ = '"TTI_Client"={id,name={Cass,Brock,Errant},phone},' C            address$ = 'address={%BAR,street,city,state,country},' 4            misc$ = 'misc={%REPLACE,mail,record}'   S            menu$ = title$ & box_loc$ & client$ & address$ & misc$ /        20  LINE INPUT MENU menu$: ans$         30  END          RNH (               +---STRUCTURE---+ 4               |  TTI_CLIENT  +---ADDRESS--+ 4               |  ADDRESS     |------------| -               |  MISC...     |  STREET    | -               +--------------|  CITY      | -                              |  STATE     | -                              |  COUNTRY   | -                              +------------+ 


2

5.17.1 Items



GMenu items consist of either a description or a description and = sign Ifollowed by either a data value or a submenu indicator. If no = sign is Jgiven, the data value is the same as the description. If the description Jcontains spaces or special characters, it must be enclosed within quotes. 

=

5.17.1.1 Descriptions



DMenu descriptions are displayed on the menu for the user to choose. 

;

5.17.1.2 Data Value



FThe data value is the value returned to the application when the menu item is chosen. 

>

5.17.2 Submenu Indicator



IA submenu indicator consists of a "{" followed by menu elements followed by "}". 

=

5.17.3 Menu DIRECTIVES:

KThe following directives can be used with the [LINE] INPUT MENU statement: 



%AT row, column



BThe 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 


%AUTODISPLAY



@The %AUTODISPLAY directive controls display of submenus. IUnless specifically turned OFF, INTOUCH automatically displays submenus. 

FORMAT: 

        %AUTODISPLAY [ON|OFF] 


%AUTOVBAR



=The %AUTOVBAR directive is used to turn vertical bars EON 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: 

Z        10 item1$='%MENUBAR,%AUTOVBAR on,OPEN,SELECT={INCLUDE,EXCLUDE},SORT,PRINT' )           LINE INPUT MENU item1$ : ans$            END          RNH  V        +---------------------------------------------------------------------------+ V        |  OPEN   |   SELECT   |   SORT   |   PRINT                                 | V        +-----------+---SELECT---+--------------------------------------------------+ #                    |  INCLUDE   | #                    |  EXCLUDE   | #                    +------------+ 

%BAR



=Separates DESCRIPTIVE-items with "----". The separated line 6consists of the characters specified in a "text_str". CIf no text is given, the separated line defaults to a dashed line. 

FORMAT: 

        %BAR ['text_str'] 


EXAMPLE: 

E        10 menu$ = '"DATA ENTRY","REPORTS",%BAR"*",MAIL,EXIT' (           LINE INPUT MENU menu$ : ans$         20 END          RNH          +---------------+         |  DATA ENTRY   |         |  REPORTS      | !        |  **********   |         |  MAIL         |         |  EXIT         |         +---------------+ 


%COLUMNS



=The %COLUMNS directive sets the number of columns for the menu. 

FORMAT: 

        %COLUMNS number 


EXAMPLE: 

M        10 menu$ = '%COLUMNS 3,"DATA ENTRY","REPORTS",MAIL,HELP,EXIT' (           LINE INPUT MENU menu$ : ans$         20 END          RNH  0        +-------------------------------------+ 0        |  DATA ENTRY   |   HELP   |   EXIT   | 0        |  REPORTS      |   MAIL   |          | 0        +-------------------------------------+ 


%HEADING



:The %HEADING directive displays a blank line and a D"text_str" between menu items. If no "text_str" is given, the line defaults to a dashed line. 

FORMAT: 

        %HEADING ['text_str'] 


EXAMPLE: 

Z        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     |         +------------------+ 


%ITEMS



9The %ITEMS directive creates a multi-column menu. 4"number" represents the number of items per column. 7%ITEMS creates as many columns as is necessary. )Horizontal scroll the columns as needed. 

FORMAT: 

        %ITEMS number 


EXAMPLE: 

N        10  menu$='ENGINES={%ITEMS 3, DBMS, RMS, ADABASE, RDB, DBASE}' #            INPUT MENU menu$: ans$         20  END          RNH  .        +----------+------------------------+ .        |  ENGINES |  DBMS      |   RDB     | .        +----------|  RMS       |   DBASE   | .                   |  ADABASE   |           | .                   +------------------------+ 


%LOCKSTEP



9The %LOCKSTEP directive controls column scrolling Cwhen there are multiple columns in one menu. If it is turned OFF, Athe columns scroll independently. Otherwise, the columns scroll together. 

FORMAT: 

        %LOCKSTEP [ON|OFF] 


EXAMPLE: 

V        10 menu$ = '%LOCKSTEP off, %SIZE 4, 1,2,3,4,5,6,%SPLIT,7,8,9,10,11,12' (           LINE INPUT MENU menu$ : ans$ 0           PRINT 'Please, PRESS the "NEXT" key'         20 END          RNH  +        Please, PRESS the 'NEXT' key         +---------------+         |  ... |   7    |         |  4   |   8    |         |  5   |   9    |         |  6   |   ...  |         +---------------+ 


%MAXWIDTH



:The %MAXWIDTH directive controls the maximum width of the entire menu. 

FORMAT: 

        %MAXWIDTH number 


EXAMPLE: 

E        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       |         +--------------------+ 


%MENUBAR



<The %MENUBAR directive creates menu bars (menus with 7choices listed horizontally) with pull-down submenus. 

FORMAT: 

        %MENUBAR 


EXAMPLE: 

M        10 item1$='%MENUBAR,OPEN,SELECT={INCLUDE,EXCLUDE},SORT,PRINT' )           LINE INPUT MENU item1$ : ans$         20 END          RNH  V        +---------------------------------------------------------------------------+ V        |  OPEN      SELECT      SORT      PRINT                                    | V        +----------+---SELECT---+---------------------------------------------------+ "                   |  INCLUDE   | "                   |  EXCLUDE   | "                   +------------+ 


%MESSAGE



?The %MESSAGE directive displays a message when the menu or submenu is displayed. 

FORMAT: 

        %MESSAGE 'message' 


EXAMPLE: 

        10  CLEAR N        20  menu$ = 'open,show,print, %MESSAGE "Select a menu option"' (            LINE INPUT MENU menu$: ans$         30  END          RNH          +----------+         |  OPEN    |         |  SHOW    |         |  PRINT   |         +----------+     9                              Select a menu option


%MULTI



AThe %MULTI directive allows multiple items to be selected from a menu or submenu. 



%REPLACE



=The %REPLACE directive can be located in any submenu. FThe calling menu is not kept on the screen. Pressing '\' will return to the calling menu. 



%SIZE number



MDetermines the number of DESCRIPTIVE-items that are located in the menu_box. 

JThere is no limit to the number of the items that can be used. If all of Lthe items do not fit within the menu box, the items are vertically scrolled Lusing the UP, DOWN, NEXT and PREV keys. "Str_var" contains the name of the Nselected item. If the %MULTI directive is used and the Select key Eis pressed, "Str_var" contains the names of the items. Each item is #separated by a linefeed character. 



%SPLIT



9The %SPLIT directive instructs INTOUCH to start a 0new 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   |          | *                   +--------------------+ 


%TITLE ".........."



%Assign a title to a menu or submenu. 



%VBAR



:The %VBAR directive is used to explicitly insert a vertical bar. 

FORMAT: 

        %VBAR 


EXAMPLE: 

S        10 item1$='%MENUBAR,OPEN,%VBAR,SELECT={INCLUDE,EXCLUDE},SORT,PRINT' )           LINE INPUT MENU item1$ : ans$            END          RNH  V        +---------------------------------------------------------------------------+ V        |  OPEN   |   SELECT      SORT      PRINT                                   | V        +-----------+---SELECT---+--------------------------------------------------+ #                    |  INCLUDE   | #                    |  EXCLUDE   | #                    +------------+ 


%WIDTH



>The %WIDTH directive controls the minimum width of the current column. 

FORMAT: 

        %WIDTH number 


EXAMPLE: 

B        10  menu$ = '%WIDTH 20,%ITEMS 2,a,b,c,d,f,g,h,i,j' $            INPUT MENU menu$ : ans$         20  END          RNH  Y        +------------------------------------------------------------------------------+ e        |<<  C                 |   F                 |   H                           >>| Y        |    D                 |   G                 |   I                             | Y        +------------------------------------------------------------------------------+ 
;

5.17.4 User Interface



<The following is the user interface in a [LINE] INPUT MENU: 





2

5.18 KEY INPUT



FORMAT:



2        KEY INPUT [[#channel] [, PROMPT str_expr] $             [, TIMEOUT time_limit] !             [, ELAPSED num_var]              :] var, [var,...] 


EXAMPLE:



+        10  PRINT 'See how quick you are.' :        20  KEY INPUT PROMPT 'Press a key, quick!', & $                  ELAPSED x: press$         30  PRINT B            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. 


PURPOSE:





AKEY INPUT inputs a keystroke from the user and stores the 3value of the key in the string variable specified. 





DESCRIPTION:





ESome applications require the use of special keys on the terminal or Gkeystroke level validation. The KEY INPUT statement is used for these applications. 

KKEY INPUT does not echo the key pressed, nor does it generate a line feed. 

CAll the options available with the preceding "INPUT" statement are Aalso available with KEY INPUT. KEY INPUT returns the following: 



K_TERMINATOR returns control (Ctrl) characters in the format "CTRL/X". For Nexample, if the user presses Ctrl/G, _TERMINATOR returns "CTRL/G". 

7        10  KEY INPUT 'Press a terminator' : z$             PRINT .            PRINT 'You pressed '; _TERMINATOR         20  END          RNH H        Press a terminator?            (User presses CTRL/G)         You pressed CTRL/G 




J

Chapter 6
Printing and Displaying Data



,

6.1 PRINT



BThe PRINT statement prints or displays text on the screen. OThe printed text can be formatted using a mask or directive and/or highlighted Lusing video options. This section describes the various ways that text can be displayed on the screen. 



FORMAT:



O        PRINT [[AT row, col] [,ERASE] [,WIDE] [,BLINK] [,UNDERLINE] [,REVERSE] G        [,BOLD] [,USING "print_mask"]:] expr [{, | ;} expr...] [, | ;] 


EXAMPLE:



        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 


DESCRIPTION:





0The simplest version of the PRINT statement is: 

        PRINT expr 


?expr is an expression to print. expr can be any GINTOUCH expression. INTOUCH prints the value of the expression at the Jcurrent cursor position and then generates a new line. A PRINT statement 3without an expression simply generates a new line. 

IThe [?] 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 

H

6.1.1 Printing Multiple Expressions



EOne 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: 







Semicolons



ESeparating print items with a [semicolon] causes the items to Gimmediately 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 


Commas and Print Zones



<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. 

  F        |-------------------|-------------------|-------------------| F        1                  20                  40                  60 


?Separating items with a comma causes the item following Athe comma to be printed in a new print zone. The terminal width Mdetermines 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 5        FRED                MARY                JOHN 


HIf an item is longer than the zone width, INTOUCH continues it into the Inext print zone. INTOUCH uses as many print zones as necessary to print an item. 

        RNH +        ? FRED, DILLENSCHNEIDER & SONS K        FRED                MARY                DILLENSCHNEIDER & SONS 


EINTOUCH writes data sequentially. If an item is too long (over 132 Mcharacters) to write in one record, INTOUCH continues it in the next record. 

4        10  OPEN #1: NAME 'test.tmp', ACCESS OUTPUT )            PRINT #1: REPEAT$('+-', 100)             CLOSE #1 3        20  OPEN #1: NAME 'test.tmp', ACCESS INPUT 0            LINE INPUT #1: record_1$, record_2$ *            PRINT 'Record 1: '; record_1$ *            PRINT 'Record 2: '; record_2$             CLOSE #1         30  END          RNH         Record 1: Y        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- =        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- W        Record 2: +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- 
7

6.1.2 TAB Function



@The TAB function moves the print position to a specified column. 

FORMAT:



        TAB(column) 


Icolumn is the column position to print. TAB positions the cursor Kat the column specified. TAB always moves forward (to the right). If the Kcursor is at or past the column specified, INTOUCH jumps to the next line. NThe 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$ E        20  PRINT TAB(5); name_1$; TAB(20); 'MARY'; TAB(35); name_2$         30  END  "        RNH                       "        ? FRED, JOHN              /            FRED           MARY           JOHN 
4

6.1.3 AT Option



>The AT option moves the cursor to a specificed row and column on the screen. 

FORMAT:



        AT row, column 


@row is the row to print at. column is the column Cto print at. Row and column can be any integer numeric constants. 

#        10  INPUT name_1$, name_2$         20  CLEAR F        30  PRINT AT 3,10: name_1$; TAB(20); 'Mary'; TAB(35); name_2$         40  END          RNH         ? Fred, John   /                 FRED      MARY           JOHN 
7

6.1.4 ERASE Option



@The ERASE option erases from the end of the printed text to the end of the line. 

        10  CLEAR 5        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 
6

6.1.5 WIDE Option



BThis option prints double-width characters on the terminal screen. 

"        10  PRINT WIDE: 'INTOUCH'         20  END 
;

6.1.6 Printing Numbers



4The following rules govern the printing of numbers: 





INTOUCH prints: 







4


Next page... | 6Table of Contents