INTOUCH® 4GL Application Development Guide

INTOUCH® 4GL
Application Development Guide

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 

Last revised: May 1997 for V4.4

Copyright ©1993, 1999 Touch Technologies, Inc.

Contents Index


Preface

INTOUCH 4GL

INTOUCH is a high performance 4GL, which blends many 3GL and 4GL capabilities, making it the most powerful and flexible language on OpenVMS systems.

INTOUCH is not what you would expect from a typical 4GL. Not only is it fast and efficient at using system resources, its methods of I/O optimization make it speedier than other 4GLs, including many 3GLs on I/O intensive applications.

About this Manual

This is one of several reference manuals describing the INTOUCH system. All 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.

The INTOUCH Application Development Guide presents the INTOUCH language by application topic. Not only does it help you find the right INTOUCH statements for your application, but it offers hints and provides examples to back them up.

Purpose

The purpose of this INTOUCH Application Development Guide is to help you through building INTOUCH 4GL based applications. This guide assumes that you have a programming background. It also assumes that you have access to the INTOUCH---A Guide to the Language manual.

Organization

In order to facilitate its ease of use, the INTOUCH Application Development Guide is organized by application topic. Each chapter of the guide addresses one such topic (i.e. Controlling Screen Appearance, User Input, etc.). Chapter sections then approach the application at the statement level and present you with suggested INTOUCH statements. However, it is suggested that you keep the INTOUCH - A Guide to the Language manual handy for detailed reference of statement format. Examples are given to aid in your understanding.


Chapter 1
Controlling the Screen Appearance

The ability to control the appearance of the screen is important to any applications programmer. INTOUCH gives programmers this control by allowing them to manipulate the entire screen and specific areas of the screen.

The sections which follow briefly explain how to manipulate the screen.

1.1 INTOUCH Screen Frame

When you get into INTOUCH (by typing the word INTOUCH), the INTOUCH screen frame is displayed.

Example 1-1 INTOUCH Screen Frame


INTOUCH 4.4                   Program: NONAME    1                              
The Next Generation Language  Status :           2                              
                        1                        3 
                        2                        4 
                        3                        5      print at 7,1: 
                        4                        6        prints on 
    print at 7,1:       5                        7   <--- this line 
      prints on         6                        8 
      this line  --->   7                        9      when the 
                        8                       10      INTOUCH screen 
    when the            9                       11      frame is OFF 
    INTOUCH screen     10                       12 
    frame is ON        11                       13 
                       12                       14 
                       13                       15 
                       14                       16 
                       15                       17 
                       16                       18 
INTOUCH                17                       19 
                       18                       20 
cursor                 19                       21 
                       20                       22                              
                 Messages are displayed on screen line 23                       
EXIT = Exit                                     24         \ = Back  HELP = Help

On a VT terminal, there are 21 available rows on the screen when the INTOUCH screen frame is on. There are 24 rows when the frame is off. There are 80 columns or 132, depending on the terminal's margin setting. INTOUCH messages are displayed on line 23 or one row up from the bottom of the screen if your terminal has more/less than 24 lines.

Note

The examples shown in this manual are run with the INTOUCH screen frame OFF.

1.2 Clearing the Screen

INTOUCH allows you to clear either the entire screen or rectangular areas of the screen using the CLEAR statement.

If you want to enhance the cleared area of the screen with attributes, BOLD, BLINK, REVERSE and UNDERLINE, specify the desired option(s) in the statement followed by the ":" option identifier. Multiple items can be used separated by commas.

You can also replace the cleared area with a box by using the BOX option.

Example

The following example clears the screen and specific areas of the screen.


        1   program application_1_1 
        10  clear
        20  print at 1,1:; 
            for x = 1 to 16 
              print x; tab(5); repeat$('X', 70) 
            next x 
        30  message 'Lines 4 and 5 will be cleared' 
            delay 5 
            clear area 4, 1, 5, 80
        40  message 'Parts of lines 8 and 9 will be cleared and reversed' 
            delay 5 
            clear area reverse: 8, 15, 9, 55
        50  message ' Parts of lines 12 thru 15 will be cleared and boxed' 
            delay 5 
            clear area box, bold: 12, 25, 15, 45
            delay 5 
        60  end 

?10pc Text is printed to the screen. Rows and areas of the screen are cleared in various ways. Lines 4 and 5 are cleared first.



 1  XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 
 2  XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 
 3  XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 
 
 
 6  XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 
 7  XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 
 8  XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 
 9  XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 
 10 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 
 11 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 
 12 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 
 13 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 
 14 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 
 15 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 
 16 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 
 
 
 
 
 
                         Lines 4 and 5 will be cleared 

?10pc Parts of lines 8 and 9 are cleared and shown in reverse video. Parts of lines 12 thru 15 are cleared and the area is boxed.



 1  XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 
 2  XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 
 3  XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 
 
 
 6  XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 
 7  XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 
 8  XXXXXXXXXX                                         XXXXXXXXXXXXXXXXXXX 
 9  XXXXXXXXXX                                         XXXXXXXXXXXXXXXXXXX 
 10 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 
 11 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 
 12 XXXXXXXXXXXXXXXXXXXX+-------------------+XXXXXXXXXXXXXXXXXXXXXXXXXXXXX 
 13 XXXXXXXXXXXXXXXXXXXX|                   |XXXXXXXXXXXXXXXXXXXXXXXXXXXXX 
 14 XXXXXXXXXXXXXXXXXXXX|                   |XXXXXXXXXXXXXXXXXXXXXXXXXXXXX 
 15 XXXXXXXXXXXXXXXXXXXX+-------------------+XXXXXXXXXXXXXXXXXXXXXXXXXXXXX 
 16 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 

1.2.1 Boxes and Screen Frames

Boxes are often used to highlight data on the screen. A user tends to focus on items which stand out. Boxes can be created to frame a screen or to frame sections of text displayed on the screen.

INTOUCH allows you to create boxes with the BOX option of the CLEAR AREA statement. Given a rectangular area of upper left and lower right coordinates, INTOUCH outlines the area with a box.

If you want to enhance the box with attributes (i.e. BOLD, BLINK, REVERSE, UNDERLINE), specify the desired attribute(s) as options listed after the BOX option and followed by the box coordinates.

Example

This example draws several boxes and prints data inside a box.


        1   program application_1_2 
        10  clear 
            clear area box : 6, 10, 12, 60
            message 'Here is the 1st box' 
            delay 5 
            clear area box : 3, 25, 15, 45
            message 'Here is the 2nd box' 
            delay 5 
            clear area 6, 25, 12, 45 
            message 'A boxed area is cleared' 
            delay 5 
            clear area box, reverse : 7, 26, 11, 44
            message 'Here is the 3rd box done in reverse video' 
            delay 5 
            print at 9, 28 : 'Inside the box' 
            message 'Printing inside of a box' 
            delay 5 
        20  end 



         +-------------------------------------------------+ 
         |                                                 | 
         |                                                 | 
         |                                                 | 
         |                                                 | 
         |                                                 | 
         +-------------------------------------------------+ 
 
 
 
 
 
                          Here is the 1st box 



                        +-------------------+ 
                        |                   | 
                        |                   | 
         +--------------                     --------------+ 
         |               +-----------------+               | 
         |               |                 |               | 
         |               | Inside the box  |               | 
         |               |                 |               | 
         |               +-----------------+               | 
         +--------------                     --------------+ 
                        |                   | 
                        |                   | 
                        +-------------------+ 
 
 
 
 
 
                       Printing inside of a box 

Screen frames similar to the INTOUCH screen frame are often used in application programs. Screen frames can be used to identify user procedures.

Example


        1   program application_1_3 
        10  clear 
            z$ = space$(80) 
            cset z$ = 'Customer Maintenance' 
            print reverse, bold, at 1, 1: z$; 
            z1$ = 'EXIT = Exit' + space$(48) + '\ = Back  HELP = Help' 
            print reverse, bold, at 24, 1 : z1$; 
            print at 3, 1: 'Name    :' 
            print at 4, 1: 'Address :' 
            print at 5, 1: 'City    :' 
            print at 6, 1: 'State   :' 
            print at 7, 1: 'Zip     :' 
            delay 
            clear 
        20  end 



                              Customer Maintenance                              
 
Name    : 
Address : 
City    : 
State   : 
Zip     : 
 
 
 
 
 
                        Press the RETURN key to continue 
EXIT = Exit                                                \ = Back  HELP = Help

1.3 Saving and Restoring the Screen

There are times when you want to save a screen and restore it later.

The ASK WINDOW statement takes a snapshot of the current screen or a part of it and saves it in a string variable.

The SET WINDOW statement restores a previously saved screen or part of a screen.

Example

The following example prints a screen, saves the screen display and restores the saved screen.


        1   program application_1_4 
        10  clear 
        20  print at 5,5 : repeat$('*', 40) 
            print at 6,5 : repeat$('*', 40) 
            print at 7,15 : 'This is screen 1' 
            print at 8,5 : repeat$('*', 40) 
            print at 9,5 : repeat$('*', 40) 
            message 'Screen 1 will be saved and Screen 2 will be displayed' 
            delay 5 
            ask window: current screen_1$
            clear 
        30  print at 5,5 : repeat$('#', 40) 
            print at 6,5 : repeat$('#', 40) 
            print at 7,15 : 'This is screen 2' 
            print at 8,5 : repeat$('#', 40) 
            print at 9,5 : repeat$('#', 40) 
            message 'Screen 2 will be replaced by screen 1' 
            delay 5 
        40  set window: current screen_1$
        50  delay 5 
        60  end 

?10pc Screen 1 is printed and saved:



    **************************************** 
    **************************************** 
              This is screen 1 
    **************************************** 
    **************************************** 
 
 
 
 
 
             Screen 1 will be saved and Screen 2 will be displayed 

?10pc Screen 2 is printed to the screen:



    ######################################## 
    ######################################## 
              This is screen 2 
    ######################################## 
    ######################################## 
 
 
 
 
 
                     Screen 2 will be replaced by screen 1 

?10pc Screen 1 is restored:



    **************************************** 
    **************************************** 
              This is screen 1 
    **************************************** 
    **************************************** 
 
 
 
 
 
             Screen 1 will be saved and Screen 2 will be displayed 

1.3.1 Saving and Restoring Screen Areas

You can also save and restore specific areas of the screen.

Example

The following example shows how areas of the screen are saved and restored.


        1   program application_1_5 
        10  clear 
        20  print at 4,5 : repeat$('*', 40) 
            print at 5,5 : repeat$('*', 40) 
            print at 6,15 : 'This is area 1' 
            print at 7,5 : repeat$('*', 40) 
            print at 8,5 : repeat$('*', 40) 
            print at 11,5 : repeat$('#', 40) 
            print at 12,5 : repeat$('#', 40) 
            print at 13,15 : 'This is area 2' 
            print at 14,5 : repeat$('#', 40) 
            print at 15,5 : repeat$('#', 40) 
            message 'Areas 1 and 2 are going to be saved' 
            delay 5 
        30  ask window area 4, 1, 8, 80 : data screen_1$
            ask window area 11, 1, 15, 80 : data screen_2$
            set window area 4, 1, 8, 80 : data screen_2$
            message 'Area 1 has been overlayed by Area 2' 
            delay 5 
        40  set window area 11, 1, 15, 80 : data screen_1$
            message 'Area 2 has been overlayed by Area 1' 
        50  end 

?10pc Data is displayed on the screen and the areas are saved.



    **************************************** 
    **************************************** 
              This is area 1 
    **************************************** 
    **************************************** 
 
 
    ######################################## 
    ######################################## 
              This is area 2 
    ######################################## 
    ######################################## 

?10pc The saved areas are restored to different sections of the screen.



    ######################################## 
    ######################################## 
              This is area 2 
    ######################################## 
    ######################################## 
 
 
    **************************************** 
    **************************************** 
              This is area 1 
    **************************************** 
    **************************************** 


Next Contents Index