M!INTOUCH® 4GL Y

INTOUCH® 4GL
A Guide to the INTOUCH Language

>
Previous page... 6Table of Contents
:

1.7 Messages in INTOUCH



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




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



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

L

1.8 Using the Tab Key Features



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

G

1.8.1 Tab Key Indenting



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





=

1.8.2 Command Completion



IWhen entering an INTOUCH command, you can enter part of the command, and Nthen press the Tab key. INTOUCH will then supply the full name of Ithe 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: 




520 soTab <--- your entry  120 sort <--- INTOUCH supplies 



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




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

>

1.8.3 Spelling Correction



KThe Tab key can be used to correct misspelled words in INTOUCH. LJust position the cursor on the misspelled word and press the TabKkey. 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 strctreTab50 set structure 

B

1.8.4 Expanding Abbreviations



HINTOUCH uses abbreviations for a number of statements. You can use the HTab key with any of the specific abbreviations to expand the Jappreviations. To use this feature, enter an abbreviation and then press Ithe 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



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

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

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


>

Chapter 2
INTOUCH Commands

X

2.1 Presentation of Command and Statement Information



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

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



FORMAT:



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




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

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

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

FINTOUCH is space sensitive, so spaces must be included where they are Eshown 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 Irepresentations, bracket usage and other conventions used in this Guide, 2you can refer to Conventions Used in this Manual. 





EXAMPLE:



C        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 




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

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





PURPOSE:





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



DESCRIPTION:





FThe DESCRIPTION is a detailed description of the command or statement Fwhich 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 Bcan 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

7

2.3 INTOUCH Commands



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

.

2.3.1 NEW



FORMAT:



        NEW ['workspace_name'] 


EXAMPLE:




WINTOUCH 4.2 Program: print_name WThe Next Generation Language Status :     INTOUCH  NEW 'print_name'  INTOUCH  W WEXIT = Exit \ = Back HELP = Help



DESCRIPTION:





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



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

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






,

Note

CWhen you use the NEW command, current memory is cleared and Iany programs in memory are lost. Therefore, if you want to save what is Gin current memory, you need to do a SAVE or REPLACE before you use the INEW 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. 

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

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

-        SAVE 'testdisk:[programs]print_name' 


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

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

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

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



2

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. 

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

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



0

2.3.4 ABORT



FORMAT:



        ABORT [int_expr] 


EXAMPLE:




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





DESCRIPTION:





7ABORT aborts INTOUCH without saving your latest changes. 

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

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




INTOUCH ABORT 200  W ^ 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 C        %SYSTEM-W-GSDFULL, global section descriptor table is full 
        $ 
6

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:





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

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

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

DYou can give a file specification with the RUN command. If a file Hspecification is provided, INTOUCH searches for the file, loads it, and Fthen 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



GRNH runs the specified program without displaying the program header. MOther 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:





7The OLD command loads a program you have saved. 

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

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


,

Note

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



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

EIf INTOUCH cannot find the file specified, an exception is generated 0and 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. 

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

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

JSpecific sections of a program can be listed by referencing the program's Fline numbers, labels and routines. You can also list a range of line Mnumbers (low to high) and combinations of line numbers, labels and routines. For example:  )    2    ?    :   $ 3    A  
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


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



5

2.3.8 LIST ERROR



FORMAT:



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

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



/

2.3.9 EDIT



FORMAT:



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





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



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

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

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


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

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



5

2.3.10 RENUMBER



FORMAT:



        RENUMBER 


EXAMPLE:



        3  DIM name$(5)         5  FOR i = 1 TO 5 1        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 4        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:





HRENUMBER operates on the program in current memory. RENUMBER renumbers Gor resequences the program in current memory. It takes the first line Jnumber 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 Hoff. The INTOUCH frame consists of the highlighted bars across the top <and bottom of the screen and the information they contain. 

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



4

2.3.12 REFRESH



FORMAT:



        REFRESH 


EXAMPLE:



        REFRESH 


DESCRIPTION:





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



0

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 Inumber. Use the version number when contacting Touch Technologies, Inc. with suggestions or problems. 



4

2.3.14 COMPILE

)

FORMAT:



4


Next page... | 6Table of Contents