INTOUCH® 4GL A Guide to the INTOUCH Language

INTOUCH® 4GL
A Guide to the INTOUCH Language

Touch Technologies, Inc.
9988 Hibert Street, Suite 310
San Diego, CA 92131

1-800-525-2527 or 1-619-566-3603

Note

® VAX is a registered trademark of Digital Equipment Corporation.

® INTOUCH is a registered trademark of Touch Technologies, Inc.


NOTICE

Touch Technologies, Inc. (TTI) has prepared this publication for use by TTI personnel, licensees, and customers. This information is protected by copyright. No part of this document may be photocopied, reproduced or translated to another language without prior written consent of Touch Technologies, Incorporated.

TTI believes the information described in this publication is accurate and reliable; much care has been taken in its preparation. However, no responsibility, financial or otherwise, is accepted for any consequences arising out of the use of this material.

The information contained herein is subject to change without notice and should not be construed as a commitment by Touch Technologies, Inc.

The following are trademarks of Touch Technologies, Inc., and may be used only to describe products of Touch Technologies, Inc.:


DYNAMIC TAPE ACCELERATOR        INTOUCH 4GL     INTOUCH INSA 
 
DYNAMIC LOAD BALANCER PLUS      REMOTE DEVICE FACILITY 

The following are trademarks of Digital Equipment Corporation, and may be used only to describe products of Digital Equipment Corporation:


DBMS      DCL      DECNET      OpenVMS      RDB      RMS      VAX 

Revision date: May 1997 for V4.4

Copyright ©1992, 1999 Touch Technologies, Inc.

Contents Index


Preface

INTOUCH 4GL is a next generation database language for VAX and Alpha computers. It includes a fourth-generation database language and an advanced development environment.

The INTOUCH language:

INTOUCH includes a transparent interface to the RMS file management system as well as other database engines. The interface includes:

The INTOUCH environment is designed for developing complex applications rapidly. The interactive environment:

Development cycle time is the time it takes to edit, compile, link, run and debug code. INTOUCH reduces this time by providing an interactive and fast response environment. INTOUCH offers features that cut cycle time significantly--up to 80%.

You will find INTOUCH an exciting and powerful programming tool.

About this Manual

This manual is one of two reference manuals describing the INTOUCH system. Both manuals are designed to provide the information you need in a manner that is concise and easy to use. The manuals are:

A Guide to the Language describes the INTOUCH system and how to develop programs with it. The Guide explains the development cycle and INTOUCH's features for speeding up this cycle. It describes the INTOUCH environment, program elements and the INTOUCH language and debugging system.

INTOUCH's Specifications contain a brief description of the INTOUCH system, statements, commands, etc., and some background on how the system operates.

Purpose

The purpose of this Guide is to present the information you will need to develop programs with INTOUCH. The intent is to provide you, the user, with simple and concise explanations of the INTOUCH system, features, and language. This manual is designed to provide a basic and thorough explanation of each element. This manual can also be used as a reference guide by advanced users.

Intended Audience

This Guide is written for both experienced programmers and those self-learners who have had some exposure to computers and programming languages. If you have little programming experience, or are using this manual to teach yourself, please start with chapter one.

Conventions Used in this Manual

User Conventions

In some places in this manual, the format of statements and commands is represented abstractly. For example:


                Format:     [LET] var = expr 

Certain conventions are used to represent values which you (the user) must supply. These conventions are always shown in lower-case. These are the user conventions:

Symbol Description
array Array element.
block of code An INTOUCH statement or a series of INTOUCH statements.
chnl An I/O channel associated with a file.
chnl_num An I/O channel associated with a file.
cond_expr Conditional expression.
col Column. Used in the TAB or AT option to indicate the column to print at.
const Constant value.
expr Expression. May be a variable, constant, array element, structure reference, etc. or any combination of the previous separated by operators.
field_expr Field name expression.
filename File name. (Described briefly below and in the Command Language and DCL User's Guide of the OpenVMS documentation set).
file_spec File specification. (See the Command Language and DCL User's Guide of the OpenVMS documentation set).
func Function.
handl Exception handler. Pertaining to an exception handling routine.
handler The block of code in an exception handler which is executed when an exception is generated.
int Integer value.
int_expr Integer expression.
int_var Integer variable.
label Alphanumeric statement label.
libr Pertaining to libraries.
line_num Program line number.
name Name. Indicates the declaration of a name or the name of a program unit, such as a subprogram.
num Numeric value. Num indicates that either a real or integer numeric value may be used.
num_expr Numeric expression. Num_expr indicates that either a real or integer numeric value may be used.
num_var Numeric variable.
param An expression which is passed to a function, subprogram or other program unit. A parameter can be any valid INTOUCH expression.
protected block The block of code protected by an exception handling routine.
real Real number. Indicates that only a real number may be used.
row Row. Used in the AT option to specify the row to print at.
str String. Str indicates that only a string value may be used.
str_expr String expression.
str_var String variable.
struc An INTOUCH structure.
struc_name Structure name.
struc_expr Structure expression.
sub An INTOUCH subprogram.
target The target point of a branch statement. The target can be either a program line number, an alphanumeric label, or a ROUTINE statement.
uncond_expr Unconditional expression. Uncond_expr indicates that only an unconditional expression can be used.
var Variable. May be a simple variable, array element or a structure reference.

Program Examples

In the program examples, keywords in INTOUCH statements and commands are in upper-case letters and information you (the user) supply is in lower-case. For example:


        10  OPEN STRUCTURE cl: NAME 'tti_run:client' 
            ASK STRUCTURE cl, FIELD id: CHANGEABLE z 
            ASK STRUCTURE cl, FIELD city: CHANGEABLE z1 
            PRINT z 
            PRINT z1 
            CLOSE STRUCTURE cl 
        20  END 

The double quote (") can be used in place of the single quote (') as long as they are paired and not specified.

Other Conventions

Other conventions used in this manual are:

[ ] Optional portions of a statement are enclosed in brackets.
 INPUT [PROMPT str_expr] : var

{ | } Braces combined with a vertical bar indicate that one of the elements in the braces must be chosen. The elements are separated by the vertical bar.
 EXIT {FOR | DO}

[ | ] Brackets combined with a vertical bar indicates that one of the options in the brackets can be used. The elements are separated by the vertical bar. Only one of the elements can be used.
 DO [WHILE expr | UNTIL expr]

... An ellipsis indicates that the language element can be repeated. An ellipsis following an option enclosed in braces indicates that you can repeat the format of the whole option.
 INPUT [PROMPT str_expr] : var, var...

dashes Three sets of dashes indicate a block of code.
 DO

---
--- block of code
---
LOOP
.
.
.
A vertical ellipsis indicates the continuation of a body of program code which is not a defined block of code.


Chapter 1
Working in the INTOUCH Environment

1.1 Getting Started

It is easy to start INTOUCH, simply type the word INTOUCH in upper or lower-case letters, at the system prompt (usually the $). This will put you into the INTOUCH environment and the INTOUCH screen frame will be displayed.

Example 1-1 The INTOUCH Screen Frame


INTOUCH                       Program: NONAME                                   
The Next Generation Language  Status :                                          
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
INTOUCH
 
 
                                                                                
            INTOUCH Copyright (c) 1984-1997 Touch Technologies, Inc.            
EXIT = Exit                                                \ = Back  HELP = Help

The frame consists of the two highlighted bars across the top of the screen and the three highlighted bars across the bottom. Inside the frame, is the highlighted INTOUCH prompt INTOUCH.

When you are in the INTOUCH environment you can create, edit and run INTOUCH programs, access files, and use OpenVMS system utilities. You can also change the INTOUCH environment by using the INTOUCH commands and debugging system.

1.2 Accessing the OpenVMS System Utilities

You can access the OpenVMS system utilities from within the INTOUCH environment.

To run an OpenVMS system utility program, enter $ utility_name at the INTOUCH prompt. INTOUCH will run the utility and return you to the INTOUCH environment--the INTOUCH prompt. Here is an example:

Example 1-2 Running an OpenVMS System Utility Program


INTOUCH                       Program: NONAME                                   
The Next Generation Language  Status :                                          
 
 
 
INTOUCH
 
$ show user 
      VAX/VMS User Processes at 30-APR-1996 11:42:20.29 
    Total number of users = 5,  number of processes = 16 
 
 Username      Node     Interactive  Subprocess   Batch 
 BATCH_CTL       TTI            -         1         1 
 HTTP_SERVER      JR            -         1         1 
 TESTER         FAST            5         1 
 TESTER          TTI            1 
 MRF_HANDLER    FAST            -         -         1 
 UUCP_DAEMON     TTI            -         1         3 
INTOUCH
 
 
 
                                                                                
EXIT = Exit                                                \ = Back  HELP = Help

To get into the OpenVMS system environment and still remain in INTOUCH, you can enter $$ at the INTOUCH prompt. You will be placed at the DCL prompt and the screen will appear as:



 
 
 
Passed to VMS...  Press  RETURN  when done.  USER:[TESTER] 
$$ 
 

You can run any of the OpenVMS utilities at this point. The $$ reminds you that you are still in INTOUCH. When you want to return to the INTOUCH environment, simply press the [Return] key and the INTOUCH frame (if it is on) and the INTOUCH prompt will be displayed.

1.3 Recalling Previous Commands

The INTOUCH environment handles command recall. That is, you can access previous commands entered at the INTOUCH prompt. You can recall the last 100 previously entered commands or statements by using the UP and DOWN arrow keys. (You can also use [Ctrl/B] or the [Prev] key for UP and [Ctrl/V] or the [Next] key for DOWN.)

You can also recall a previous command or statement by entering part of the command and pressing the [Find] or [PF2] key.

1.4 Getting Help when in INTOUCH

You can get help when at the INTOUCH prompt by entering HELP and pressing the [Return] key. The screen will clear and you will enter INTOUCH's HELP Facility.

Example 1-3 The INTOUCH HELP Facility


 
HELP 
 
 
  INTOUCH is The Next Generation Language for VAX computers.  This 
  help file contains information on INTOUCH. 
 
  o     For detailed and basic level help, use Language 
 
  o     To exit help, press the RETURN key repeatedly 
 
  o     To redisplay a list of available topics, type a ? 
 
  o     For information about the advantages of INTOUCH and the 
        INTOUCH manuals, type Features at the topic prompt below 
 
 
 
  Additional information available: 
 
  Features   HELP       Language   Tables 
 
Topic? 

If you want information about one of the listed topics--Features, HELP, Language, Tables--enter the topic at the "Topic?" prompt and press [Return]. Some topics have subtopics. You can select a subtopic by entering the subtopic at the "TOPIC Subtopic?" prompt.

When you want to exit out of the HELP Facility, press the [Return] key continuously until you are back at the INTOUCH prompt.

INTOUCH has an extensive library of HELP text on many topics. When in the HELP Facility, you can type a question mark (?) at any HELP topic prompt and get a list of the available topics and sub-topics.

1.5 Using INTOUCH--Some Examples

Once you enter the INTOUCH environment, all of the INTOUCH features are available to you. For example, PRINT can be executed from the INTOUCH environment and it can also be a statement in an INTOUCH program. Enter print 'hello' in upper or lower-case at the INTOUCH prompt and you will see:



INTOUCH
 
print 'hello' 
hello 
 
INTOUCH

and if you enter print date$, you will see:



INTOUCH
 
print date$ 
19960430 
 
INTOUCH

Spaces and Quotes

INTOUCH is space sensitive. As you try out the examples in this manual, be sure to type spaces where they are shown.

Either pairs of single quotes ('xxx') or pairs of double quotes ("xxx") can be used both in INTOUCH immediate mode (e.g. SAVE 'x.int' or SAVE "x.int") and within an INTOUCH program for string values (e.g. print 'hello' or print "hello").

1.5.1 Writing an INTOUCH program

Here is a sample program for you to try. Enter each line exactly as shown. At the end of each line, press the [RETURN] key.

Example 1-4 Writing a Sample Program


 
10  input 'Please enter your name': name$ 
20  print 'Hello, '; name$ 
30  end 
 

If you make an error such as misspelling the word print:

Example 1-5 INTOUCH Program Error Message


 
10  input 'Please enter your name' : name$ 
20  printt 'Hello, '; name$ 
 
20  printt 'Hello, '; name$ 
..1 
Unrecognized statement 
 
 
                                                                                
                             Unrecognized statement                             
EXIT = Exit                                                \ = Back  HELP = Help
INTOUCH will display an error message. At this point, you can either retype the line, or you can correct the line. To correct this error, use the UP arrow key to recall the line, use the left arrow key to move over to the second t, use the delete key to delete the second t and then press the [Return] key.

Now that you have typed in the sample program, you are ready to run it.


Next Contents Index