INTOUCH® 4GL
A Guide to the INTOUCH Language


Previous page... Table of Contents

1.7 Messages in INTOUCH

INTOUCH displays system, program and procedure messages within the bottom screen frame. For example:


INTOUCH .New mail on node FAST from FAST::SARALEE (22:33:15) EXIT = Exit \ = Back HELP = Help

If the screen frame is not on, messages will be displayed on the bottom line of the screen. These are INTOUCH's default message lines. If you want messages to appear elsewhere on the screen you can change the default line (see Section 9.9, ASK| SET MESSAGELINE).

1.8 Using the Tab Key Features

When in INTOUCH, the Tab key can be used to perform various operations that cut down the time it takes to write program code. As you get familiar with INTOUCH and the INTOUCH language, you will find that the Tab key features can be very helpful.

1.8.1 Tab Key Indenting

When you use the Tab key at the INTOUCH prompt or while in the INTOUCH editor, you will find that Tab indents in the following ways:

1.8.2 Command Completion

When entering an INTOUCH command, you can enter part of the command, and then press the Tab key. INTOUCH will then supply the full name of the command. If the command is ambiguous, a selection menu of all valid choices will appear.

In the following example, INTOUCH completes so to form the command sort:


20 soTab <--- your entry 20 sort <--- INTOUCH supplies

In this example, in is ambiguous, so INTOUCH provides a menu of choices:


+--Choices---+ | INCLUDE | | INF | | INPUT | +------------+ 30 in

1.8.3 Spelling Correction

The Tab key can be used to correct misspelled words in INTOUCH. Just position the cursor on the misspelled word and press the Tab key. The word will be replaced with its correct spelling. In the example below, the misspelled command SET STRCTRE is changed instantly to the correct command spelling when the Tab key is pressed.


50 set strctreTab 50 set structure

1.8.4 Expanding Abbreviations

INTOUCH uses abbreviations for a number of statements. You can use the Tab key with any of the specific abbreviations to expand the appreviations. To use this feature, enter an abbreviation and then press the Tab key. The current abbreviations that can be used are:
os. OPEN STRUCTURE
es. EXTRACT STRUCTURE
ee. END EXTRACT
in. INCLUDE
ex. EXCLUDE
fe. FOR EACH
e. EDIT
l. LIST
p. PRINT
pu. PRINT USING
ss. SET STRUCTURE
pa. PRINT AT
li. LINE INPUT
pc. PRINT #
oc. OPEN #
pe. PRINT _EXTRACTED
lm. LINE INPUT MENU
ls. LINE INPUT SCREEN

1.9 Other INTOUCH Features

You can enter INTOUCH program code at the INTOUCH prompt. You can also use the INTOUCH editor to create and change program code. Refer to Section 2.3.9, EDIT for information on the INTOUCH editor.

The appendix sections of this Guide provide information on INTOUCH's built-in fuctions, error and exception messages and other general topics. You will want to get familiar with the built-in functions as they will allow you to easily manipulate data.

Now that you have an idea of how to use and work in the INTOUCH environment, the remainder of this Guide will provide the information you need to create and use INTOUCH programs.


Chapter 2
INTOUCH Commands

2.1 Presentation of Command and Statement Information

Part of this chapter and several other chapters in this Guide describe the commands and statements in the INTOUCH language. The purpose of this section is to explain how the command and statement information is presented.

Statements that can only be used in connection with one another, such as IF THEN or the SELECT CASE statements, are described together. Each command and statement description includes the following information:

FORMAT:

        INPUT [options] var [, var...]                                (example 1) 
 
 
        EXTRACT STRUCTURE struc_name: KEY field = expr1 [TO expr2]    (example 2) 
                  --- 
                  ---  block of code 
                  --- 
        END EXTRACT 

The FORMAT contains the command or statement format. This includes the required keywords and the optional elements, if there are any.

Keywords are words that must be typed exactly as shown in the format. Keywords are shown in UPPER-CASE, e.g. EXTRACT STRUCTURE, KEY, TO, END EXTRACT. The elements in lower-case represent information that must be provided by the user in order to use the statement. For example, "struc_name" (the structure name) must be provided by the user in this statement. "field" and "expr1" information must also be provided.

Keywords and lower-case elements in brackets are optional. Multiple options are separated with commas.

INTOUCH is space sensitive, so spaces must be included where they are shown in the format. Either the single quote or double quote can be used as long as they are paired.

For information on elements (struc_name, expr1, etc.) and their representations, bracket usage and other conventions used in this Guide, you can refer to Conventions Used in this Manual.

EXAMPLE:

        10  INPUT 'Enter full name', TIMEOUT 30, ELAPSED x%: name$ 
            PRINT name$ 
            PRINT 'Elapsed time: '; x% 
        20  END 
 
        RNH 
        Enter full name? TTI Tester 
        TTI Tester 
        Elapsed time:  13 

The EXAMPLE shows how the command or statement is used. Wherever possible, the example is a full program rather than a program fragment.

You are encouraged to type in the INTOUCH examples and try running them.

PURPOSE:

In some cases, PURPOSE information is provided for usage clarity.

DESCRIPTION:

The DESCRIPTION is a detailed description of the command or statement which tells about the command or statement, explains how it works and other specific information.

2.2 About INTOUCH Commands

INTOUCH COMMANDS cause INTOUCH to take some action. You can use the commands at the INTOUCH prompt. For instance, in the following example, the command RUN executes the entered program.


10 INPUT 'Your name, please': name$ 20 PRINT 'Hello, '; name$ 30 END RUN NONAME 21-APR-1995 17:40 Your name, please? Tester Hello, Tester INTOUCH

2.3 INTOUCH Commands

The following sections describe and explain how to use many of the INTOUCH commands.

2.3.1 NEW

FORMAT:

        NEW ['workspace_name'] 

EXAMPLE:


INTOUCH 4.2 Program: print_name The Next Generation Language Status : INTOUCH NEW 'print_name' INTOUCH EXIT = Exit \ = Back HELP = Help

DESCRIPTION:

NEW clears current memory and assigns a name to the current workspace. The workspace name:

Whenever you begin writing a new program, type NEW followed by the name of the new program. If you do not enter a workspace name, INTOUCH uses the default name "NONAME".

When INTOUCH executes the NEW command, it clears current memory and assigns the name you specify or NONAME, if you do not specific a name, to the current workspace. The workspace name appears to the right of the "Program:" heading in the upper right corner of the screen.


Note

When you use the NEW command, current memory is cleared and any programs in memory are lost. Therefore, if you want to save what is in current memory, you need to do a SAVE or REPLACE before you use the NEW command. INTOUCH writes all active output buffers, closes all files and releases all storage.

2.3.2 SAVE

FORMAT:

        SAVE ['file_spec'] 

EXAMPLE:


SAVE 'print_name' INTOUCH

DESCRIPTION:

After a NEW program has been created, the SAVE command is used to save it for later use.

The SAVE command is used to save original files. An original file is one which has a unique file specification (i.e., there are no other files saved under that name). When INTOUCH saves a program, it is ordered sequentially by line number. INTOUCH saves programs as text files.

SAVE, with no file specification, saves your file under the current workspace name with an extension of .INT. You can include a complete file specification with the SAVE command. For example:

        SAVE 'testdisk:[programs]print_name' 

If a file specification is included, INTOUCH tries to save the file under the specification. (See the Command Language and DCL User's Guide Volume 2--Section 3, of the OpenVMS Version 5.5 documentation set for a description of file specifications.)

If you do not give a complete file specification, or if you do not give a directory, INTOUCH saves the program in your current (default) directory.

For the SAVE command, the file specification must be unique. If the file specification is not unique (if a file with the same name has already been saved), an exception will result. (Exceptions are discussed in Appendix C, INTOUCH's Error and Exception Messages.)

After you have saved a file once, you use the REPLACE command to save the copy or changed version.

2.3.3 REPLACE

FORMAT:

        REPLACE ['file_spec'] 

EXAMPLE:


REPLACE 'print_name' INTOUCH

DESCRIPTION:

After you make changes to a program, use REPLACE to save the new version.

The REPLACE command replaces the last version of your program with the version in current memory. If an earlier version of the file cannot be found, INTOUCH creates a new file with the specification given. file_spec is the specification for the file being replaced. If no file specification is included, INTOUCH uses the current workspace name and the default .INT.

If an earlier version does exist, INTOUCH saves the copy in current memory and increments the version number by 1. Previous versions of the file remain unchanged. The program in current memory is not changed when the REPLACE command is executed.

2.3.4 ABORT

FORMAT:

        ABORT [int_expr] 

EXAMPLE:


INTOUCH ABORT INTOUCH Finished 1-MAY-1995 17:16 FAST$

DESCRIPTION:

ABORT aborts INTOUCH without saving your latest changes.

This statement passes the ABORT status to the operating system. In this way, INTOUCH applications can force a command procedure to abort.

You can also give ABORT an OPTIONAL status value, int_expr, to pass to the operating system. int_expr is an exit status code in decimal. This value will be passed to DCL as the reason why INTOUCH aborted.


INTOUCH ABORT 200 INTOUCH Finished 1-MAY-1995 17:16 %SYSTEM-W-GSDFULL, global section descriptor table is full $

"ABORT 200" produces the same result as:

        $ exit %d200 
        %SYSTEM-W-GSDFULL, global section descriptor table is full 
        $ 

2.3.5 RUN and RNH

FORMAT:

        {RUN | RNH} ['file_spec'] 

EXAMPLE:


10 INPUT 'Your name, please': name$ 20 PRINT 'Hello, '; name$ 30 END RUN NONAME 21-APR-1995 17:40 Your name, please? Tester Hello, Tester INTOUCH

DESCRIPTION:

Use the RUN or RNH command to execute a program after it has been written.

The RUN command executes programs. RUN with no file specification (as in the above example) runs the current program in memory.

When INTOUCH executes the RUN command, INTOUCH displays a header with the program name, current date and time. INTOUCH then executes the program in memory.

You can give a file specification with the RUN command. If a file specification is provided, INTOUCH searches for the file, loads it, and then runs it. If no extension is given, INTOUCH will use the default extension .INT.


INTOUCH RUN 'testdisk:[programs]print_name' NONAME 21-APR-1995 17:40 Your name, please? Tester Hello, Tester INTOUCH

RNH runs the specified program without displaying the program header. Other than suppressing the header, RNH operates the same as the RUN command.

2.3.6 OLD

FORMAT:

        OLD ['file_spec'] 


INTOUCH OLD 'print_name' INTOUCH LIST PRINT_NAME 1-MAY-1995 20:32 10 INPUT 'Your name, please': name$ 20 PRINT 'Hello, '; name$ 30 END INTOUCH

DESCRIPTION:

The OLD command loads a program you have saved.

OLD searches for the file specified and loads it into current memory. file_spec is the specification for the file you are loading. If no extension is specified, INTOUCH uses the default extension .INT. If no file_spec is provided with the OLD command, INTOUCH tries to load the file carrying the current workspace name and an extension of .INT.

When INTOUCH loads a file, it assigns the file name (minus the extension) to the current workspace. The file name appears at the "Program:" heading in the upper right corner of the screen.


Note

When the OLD command is executed, any file previously in memory is lost.

The contents of any variables in the new program are cleared (set to zero for numeric variables and a null string for string variables).

If INTOUCH cannot find the file specified, an exception is generated and the file in current memory does not change.

2.3.7 LIST

FORMAT:

        {LIST | LNH} [label | line_num | routine {- | ,} ...] 


INTOUCH OLD 'print_name' INTOUCH LIST PRINT_NAME 1-MAY-1995 20:32 10 INPUT 'Your name, please': name$ 20 PRINT 'Hello, '; name$ 30 END INTOUCH

DESCRIPTION:

Use the LIST command to display all or part of your program source code.

LIST displays lines from the program in current memory. The listing includes a header with the program name, current date and time. The LNH command suppresses the header. LIST (or LNH) by itself lists the entire program in current memory. It lists the program sorted sequentially by line number. If no program is in current memory, nothing will be listed.

LNH lists the program without displaying the program header. Other than suppressing the header, LNH operates the same as the LIST command.

Specific sections of a program can be listed by referencing the program's line numbers, labels and routines. You can also list a range of line numbers (low to high) and combinations of line numbers, labels and routines. For example:
LIST 500, 630, 710 lists lines 500, 630 and 710
LIST 210-230, 400 lists lines 210 thru 230 and line 400
LIST do_input lists the lines of code under the label "do_input"
LIST date_routine lists the lines in the "date_routine" routine
LIST 210-230, do_input lists a line range and the label lines
LIST 21000 lists from the line number to the end of the program

If a line is specified which does not exist, nothing is listed. INTOUCH displays program lines in the order requested. Therefore, lines can be listed out of sequential order.

2.3.8 LIST ERROR

FORMAT:

        [LIST | LNH] ERROR [:label | line_num [- | ,] label | line_num...] 

EXAMPLE:

        LIST ERROR 
 
            or 
 
        LNH ERROR 

DESCRIPTION:

LIST ERROR lists compile-time errors to the terminal. LIST ERROR displays the line number and the source code of all lines with errors. LNH ERROR lists the errors without the program header, date and time.

All available options for the LIST command are available with LIST ERROR.

2.3.9 EDIT

FORMAT:

        EDIT line_num | label | routine [[- | ,] line_num | label | routine...] 

EXAMPLE:

        EDIT 410, 510-570, DO_TOTALS 

PURPOSE:

EDIT allows you to make changes to your program using a full-screen text editor.

DESCRIPTION:

EDIT transfers control to an editor. The program or a specified part of it is placed in the editor. You can then modify the program using the editor. When the editor is exited, INTOUCH returns to the INTOUCH prompt.

The INTOUCH environment is integrated into the TPU editor with EDT keypad and INTOUCH extended features. The INTOUCH editor is automatically activated when you enter EDIT.

If you do not want to use the INTOUCH editor, you will need to define the logical, INTOUCH_EDITOR, to FALSE and the EDIT symbol to the editor of your choice.

        $ DEFINE INTOUCH_EDITOR FALSE 
 
        $ DEFINE EDIT == "EDIT/EDT" 

EDIT by itself, puts the entire program in current memory. The program must be in current memory to use the EDIT command. Specific sections of a file can be edited by referencing the program's line numbers, labels and routines.

All available options for the LIST command are available to the EDIT command.

2.3.10 RENUMBER

FORMAT:

        RENUMBER 

EXAMPLE:

        3  DIM name$(5) 
        5  FOR i = 1 TO 5 
        7    INPUT 'Your name, please': name$(i) 
        8    PRINT 'Hello, '; name$(i) 
        9  NEXT i 
        10 END 
 
        RENUMBER 
 
        Pass 1, scanning source statements 
        Pass 2, changing line numbers 
        Pass 3, rebuilding source code 
        INTOUCH 
 
        LNH 
        1000  DIM name$(5) 
        1010  FOR i = 1 TO 5 
        1020    INPUT 'Your name, please': name$(i) 
        1030    PRINT 'Hello, '; name$(i) 
        1040  NEXT i 
        1050 END 

PURPOSE:

Use RENUMBER to renumber your program when you run out of room between line numbers.

DESCRIPTION:

RENUMBER operates on the program in current memory. RENUMBER renumbers or resequences the program in current memory. It takes the first line number and renumbers it 1000. Subsequent line numbers are incremented by ten and all references to line numbers are changed to match.

2.3.11 FRAME ON | OFF

FORMAT:

        FRAME {ON | OFF} 

EXAMPLE:

        FRAME ON 
        FRAME OFF 

DESCRIPTION:

FRAME OFF clears the screen and turns the INTOUCH frame off. The INTOUCH frame consists of the highlighted bars across the top and bottom of the screen and the information they contain.

FRAME ON clears the screen and turns the INTOUCH frame on.

2.3.12 REFRESH

FORMAT:

        REFRESH 

EXAMPLE:

        REFRESH 

DESCRIPTION:

REFRESH repaints the INTOUCH screen. INTOUCH clears the screen and repaints the INTOUCH frame and prompt. This includes any other information that was on the screen.

2.3.13 IDE

FORMAT:

        IDE 

EXAMPLE:


INTOUCH IDE Version 4.2 INTOUCH Copyright (c) 1984-1995 Touch Technologies, Inc. USA: (800) 525-2527 (619) 566-3603 INTOUCH

DESCRIPTION:

IDE causes INTOUCH to display its copyright and version number. Use the version number when contacting Touch Technologies, Inc. with suggestions or problems.

2.3.14 COMPILE

FORMAT:


Next page... | Table of Contents