INTOUCH® 4GL
A Guide to the INTOUCH Language


Previous page... Table of Contents

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.

Return

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 

5.17 MENU Option

Use the MENU option to create pop-up menus.

FORMAT:

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

EXAMPLE:

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

5.17.1 Items

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.

5.17.1.1 Descriptions

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

5.17.1.2 Data Value

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

5.17.2 Submenu Indicator

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:

%AT row, column

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 

%AUTODISPLAY

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

FORMAT:

        %AUTODISPLAY [ON|OFF] 

%AUTOVBAR

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

%BAR

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

%COLUMNS

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

%HEADING

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

%ITEMS

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

%LOCKSTEP

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

%MAXWIDTH

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

%MENUBAR

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

%MESSAGE

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

%MULTI

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

%REPLACE

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.

%SIZE number

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.

%SPLIT

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

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

Assign a title to a menu or submenu.

%VBAR

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

%WIDTH

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

5.17.4 User Interface

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

5.18 KEY INPUT

FORMAT:

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

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

DESCRIPTION:

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 


Chapter 6
Printing and Displaying Data

6.1 PRINT

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.

FORMAT:

        PRINT [[AT row, col] [,ERASE] [,WIDE] [,BLINK] [,UNDERLINE] [,REVERSE] 
        [,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:

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 

6.1.1 Printing Multiple Expressions

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:

Semicolons

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 

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.

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

6.1.2 TAB Function

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

FORMAT:

        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 

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

6.1.4 ERASE Option

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 

6.1.5 WIDE Option

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

        10  PRINT WIDE: 'INTOUCH' 
        20  END 

6.1.6 Printing Numbers

The following rules govern the printing of numbers:

INTOUCH prints:


Next page... | Table of Contents