INTOUCH® 4GL
A Guide to the INTOUCH Language


Previous Contents Index

EXAMPLE:


        10  PRINT 'About to print to my printer port' 
        20  SET PORT ON 
            PRINT 'This is on the printer port' 
            SET PORT OFF 
        30  PRINT 'Back to the screen again' 
        40  END 
 
        RNH 
        About to print to my printer port 
        Back to the screen again 

PURPOSE:

Allows a program to use an attached printer port on a terminal.

DESCRIPTION:

SET PORT ON | OFF turns the printer port ON or OFF. SET PORT ON turns on the attached port. SET PORT OFF turns off the attached port.

TTI_PRINTER_TYPE

To indicate the type of printer that is attached to the terminal's printer port, you can use the symbol TTI_PRINTER_TYPE.

To set up the printer type, enter the following at the system prompt (DCL level):


        $ TTI_PRINTER_TYPE == 'printer_type' 

where "printer_type" is one of the following:

Example: $ TTI_PRINTER_TYPE :=,= 'HP'

If the symbol is not defined, the type DEC is assumed.

If a terminal has a non-DEC printer port, no escape sequences are sent to the printer when you print to the printer port.

9.11.2 SET PORT OFF

FORMAT:


        SET PORT OFF 

EXAMPLE:


        10  PRINT 'About to print to my printer port' 
        20  SET PORT ON 
            PRINT 'This is on the printer port' 
            SET PORT OFF 
        30  PRINT 'Back to the screen again' 
        40  END 
 
        RNH 
        About to print to my printer port 
        Back to the screen again 

PURPOSE:

Disable printing to an attached printer port on a terminal.

DESCRIPTION:

SET PORT OFF turns off the attached port.

9.12 ASK RESPONSES

FORMAT:


        ASK RESPONSES num_var 

EXAMPLE:


        10  INPUT 'Please enter your name': name$ 
            INPUT 'What day is this': what_day$ 
            PRINT 'Hello '; name$ 
            PRINT 'Have a good '; what_day$ 
        20  ASK RESPONSES answers 
            PRINT 
            PRINT 'Responses:'; answers 
        30  END 
 
        RNH 
        Please enter your name? Ginger 
        What day is this? Wednesday 
        Hello Ginger 
        Have a good Wednesday 
 
        Responses: 2 

DESCRIPION:

ASK RESPONSES asks for the number of completed input responses.

9.13 SET SCROLL

FORMAT:


        SET SCROLL num_expr1, num_expr2 

EXAMPLE:


        10  FRAME OFF 
            PRINT AT 21, 1: 'This text will not scroll.' 
            SET SCROLL 5, 20 
            PRINT AT 20, 1:;  
            DELAY 1 
            PRINT 'This'  
            DELAY 1 
            PRINT 'text'  
            DELAY 1 
            PRINT 'will'  
            DELAY 1 
            PRINT 'scroll.'  
            DELAY 1 
        20  SET SCROLL  1,24 
        30  END 
 
        RNH 
 
        This 
        text 
        will 
        scroll 
 
        This text will not scroll. 

DESCRIPTION:

This statement sets up a scrolling region from line num_expr1 to line num_expr2.

9.14 ASK | SET SEED

FORMAT:


        ASK SEED num_var 
        SET SEED num_expr 

EXAMPLE:


        10 RANDOMIZE 
           ASK SEED seed_num 
           FOR i = 1 TO 3 
             PRINT RND(1000) 
           NEXT i 
           PRINT 'Reset the random sequence' 
           SET SEED seed_num 
           FOR i = 1 TO 3 
             PRINT RND(1000) 
           NEXT i 
        20 END 
 
        RNH 
         608 
         88 
         506 
        Reset the random sequence 
         608 
         88 
         506 

PURPOSE:

Allows you to set or reset the pseudo-random number sequence.

DESCRIPTION:

ASK SEED returns the current starting point of a pseudo-random sequence and stores the number in num_var.

SET SEED sets the starting point of a pseudo-random sequence with the number in num_expr.

9.15 ASK | SET SYSTEM

There are a number of ASK SYSTEM and SET SYSTEM statements. These are described in the following sections. The ASK/SET statements ask about and set various system operation features.

9.15.1 ASK SYSTEM: COMMENT

FORMAT:


        ASK SYSTEM: COMMENT str_var 

EXAMPLE:


        10  SET SYSTEM: COMMENT 'Invoice Entry' 
        20  ASK SYSTEM: COMMENT c$ 
        30  PRINT c$ 
        40  END 
 
        RNH 
        Invoice Entry 

DESCRIPTION:

The ASK SYSTEM: COMMENT statement asks for the INTOUCH operating system comment for the process.

9.15.2 SET SYSTEM: COMMENT

FORMAT:


        SET SYSTEM: COMMENT str_expr 

EXAMPLE:


        10  SET SYSTEM: COMMENT 'Invoice Entry' 
        20  ASK SYSTEM: COMMENT c$ 
        30  PRINT c$ 
        40  END 
 
        RNH 
        Invoice Entry 

DESCRIPTION:

The SET SYSTEM: COMMENT statement loads the INTOUCH operating system comment area with the specified string. This statement can be used in combination with the TTI_RUN:ISHOW.COM command procedure. The INTOUCH program sets the comment to some text, such as the name of the specific routine being executed. When you run TTI_RUN:ISHOW.COM, you see the specific INTOUCH program and routine within that program being run by all INTOUCH users.

9.15.3 ASK SYSTEM: DIRECTORY

FORMAT:


        ASK SYSTEM: DIRECTORY str_var 

EXAMPLE:


        10  ASK SYSTEM: DIRECTORY z$ 
            PRINT 'Current directory is: '; z$ 
        20  END 
 
        RNH 
        Current directory is: USER:[PAYROLL] 

DESCRIPTION:

ASK SYSTEM: DIRECTORY asks the operating system for the current default device and directory.

9.15.4 SET SYSTEM: DIRECTORY

FORMAT:


        SET SYSTEM: DIRECTORY str_var 

EXAMPLE:


        10  ASK SYSTEM: DIRECTORY z0$ 
            PRINT 'Current directory     '; z0$ 
            SET SYSTEM: DIRECTORY 'SYS$LOGIN' 
            ASK SYSTEM: DIRECTORY z1$ 
            PRINT 'Directory set to      '; z1$ 
            DELAY 2 
            SET SYSTEM: DIRECTORY z0$ 
            PRINT 'Directory set back to '; z0$ 
        20  END 
 
        RNH 
        Current directory      USER:[TESTER.INTOUCH] 
        Directory set to       USER:[TESTER] 
        Directory set back to  USER:[TESTER.INTOUCH]          

DESCRIPTION:

SET SYSTEM: DIRECTORY sets the default device and directory.

9.15.5 ASK SYSTEM, LOGICAL: VALUE

FORMAT:


        ASK SYSTEM, LOGICAL str_expr: VALUE str_var 

EXAMPLE:


        10  ASK SYSTEM, LOGICAL "SYS$SCRATCH": VALUE scr$ 
        20  PRINT '"SYS$SCRATCH" points to: '; scr$ 
        30  END 
 
        RNH 
        "SYS$SCRATCH" points to: USER:[TESTER] 

DESCRIPTION:

ASK SYSTEM, LOGICAL asks the operating system to translate the logical name in str_expr and place the result into the variable specified by str_var.

9.15.6 SET SYSTEM, LOGICAL: VALUE

FORMAT:


        SET SYSTEM, LOGICAL str_expr1: VALUE str_expr2 

EXAMPLE:


        10  SET SYSTEM, LOGICAL 'SYS$SCRATCH': VALUE 'USER:[TESTER]' 
            ASK SYSTEM, LOGICAL 'SYS$SCRATCH': VALUE z$ 
            PRINT 'Logical set to '; z$ 
        20  END 
 
        RNH 
        Logical set to USER:[TESTER] 

DESCRIPTION:

This statement sets the operating system logical name in str_expr1 to the value in str_expr2.

9.15.7 ASK SYSTEM: MODE

FORMAT:


        ASK SYSTEM: MODE str_var 

EXAMPLE:


        10  ASK SYSTEM: MODE process_mode$ 
        20  PRINT 'Process Mode: '; process_mode$ 
        30  END 
 
        RNH 
        Process mode: INTERACTIVE 

DESCRIPTION:

This statement returns the mode of the process which is one of the following:

9.15.8 ASK SYSTEM: PARAMETER

FORMAT:


        ASK SYSTEM: PARAMETER str_var 

EXAMPLE:


         1  PROGRAM test_param.int 
        10  ASK SYSTEM: PARAMETER pdata$ 
        20  PRINT 'Parameter was: '; pdata$ 
        30  END 
 
        INTOUCH
 
        SAVE 'test_param' 
 
        INTOUCH
                                      parameter 
                                     ------------ 
                                    |            | 
        $ INTOUCH/SOURCE test_param show parameter 
        Parameter was: SHOW PARAMETER 
 
        INTOUCH

PURPOSE:

ASK SYSTEM: PARAMETER returns any parameter from the command line given after the program name and places it in str_var.

DESCRIPTION:

ASK SYSTEM: PARAMETER lets you obtain the command line that invoked INTOUCH. The statement gives you the part of the command line after the program name.

9.15.9 ASK SYSTEM, PASS: SUCCESS

FORMAT:


        ASK SYSTEM, PASS: SUCCESS num_var 

EXAMPLE:


        10  OPEN #1: NAME 'report.lis', ACCESS OUTPUT 
            PRINT #1: 'sample report' 
            CLOSE #1 
            PASS 'PRINT/HOLD REPORT.LIS' 
            ASK SYSTEM, PASS: SUCCESS okay 
            IF  okay  THEN 
              PRINT 'Report queued for printing' 
            ELSE 
              PRINT 'Unable to queue report for printing' 
            END IF 
        20  END 
 
        RNH 
        Report queued for printing 

DESCRIPTION:

This statement asks the operating system to return a TRUE (1) if true or FALSE (0) if false indicating whether or not the last PASS command executed successfully.

9.15.10 ASK SYSTEM: PROCESS

FORMAT:


        ASK SYSTEM: PROCESS str_var 

EXAMPLE:


        10  ASK SYSTEM: PROCESS process$ 
        20  PRINT 'Process is: '; process$ 
        30  END 
 
        RNH 
        Process is: TESTER_13B_3 

DESCRIPTION:

ASK SYSTEM: PROCESS str_var asks the operating system for the current process name.

9.15.11 SET SYSTEM: PROCESS

FORMAT:


        SET SYSTEM: PROCESS str_expr 

EXAMPLE:


        10  ASK SYSTEM: PROCESS process$ 
            curr_process$ = process$ 
            PRINT 'Current process is: '; curr_process$ 
        20  new_process$ = 'DO_TEST' 
            SET SYSTEM: PROCESS new_process$ 
            ASK SYSTEM: PROCESS process$ 
            PRINT 'New process is: '; process$ 
        30  SET SYSTEM: PROCESS curr_process$ 
            ASK SYSTEM: PROCESS process$ 
            PRINT 'Old process restored: '; process$ 
        40  END 
 
        RNH 
        Current process is: TESTER_13B_3 
        New process is: DO_TEST 
        Old process restored: TESTER_13B_3 

DESCRIPTION:

SET SYSTEM: PROCESS str_expr changes the operating system process name to str_expr.

9.15.12 ASK SYSTEM: RIGHTS

FORMAT:


        ASK SYSTEM: RIGHTS str_var 

EXAMPLE:


        10  ASK SYSTEM: RIGHTS process_rights$ 
            PRINT 'Your process rights are: '; process_rights$ 
        20  END 
 
        RNH 
        Your process rights are: FAST_ACCESS,TEST_ACCESS 

DESCRIPTION:

ASK SYSTEM: RIGHTS asks the operating system to return a list of the rights explicitly granted to the calling process.

9.15.13 ASK SYSTEM, SYMBOL: VALUE

FORMAT:


        ASK SYSTEM, SYMBOL str_expr: VALUE str_var 

EXAMPLE:


        10  ASK SYSTEM, SYMBOL 'INTOUCH': VALUE symbol$ 
            PRINT 'Value of symbol INTOUCH is: '; symbol$ 
        20  END 
 
        RNH 
        Value of symbol INTOUCH is: $intouch_image: 

DESCRIPTION:

This statement asks the operating system to translate the symbol name in str_expr and place the result into the variable specified by str_var.

9.15.14 SET SYSTEM, SYMBOL: VALUE

FORMAT:


        SET SYSTEM, SYMBOL str_expr1: VALUE str_expr2 

EXAMPLE:


        10  SET SYSTEM, SYMBOL 'mysym': VALUE 'hello' 
            ASK SYSTEM, SYMBOL 'mysym': VALUE z$ 
            PRINT 'Symbol set to '; z$ 
        20  END 
 
        RNH 
        Symbol set to HELLO 

DESCRIPTION:

This statement sets the operating system symbol name in str_expr1 to the value in str_expr2.

9.15.15 ASK SYSTEM: USER

FORMAT:


        ASK SYSTEM: USER str_var 

EXAMPLE:


        10  ASK SYSTEM : USER uname$ 
        20  PRINT 'User is: '; uname$ 
        30  END 
 
        RNH 
        User is: TESTER 

PURPOSE:

This statement returns the operating system name or ID for the user. Under OpenVMS this is the Username.

9.16 ASK | SET WINDOW

There are various ASK WINDOW and SET WINDOW statements. These are described in the following sections. The ASK/SET WINDOW statements ask about and reset different screen features.

9.16.1 ASK WINDOW AREA

FORMAT:


        ASK WINDOW AREA row, col, row, col: DATA str_var 

EXAMPLE:


        10  CLEAR 
        20  PRINT AT 10, 4: 'Mary had a'; 
            PRINT AT 11, 4: 'little lamb'; 
        30  ASK WINDOW AREA 10, 4, 11, 15: DATA x$ 
        40  PRINT 
            PRINT x$ 
        50  END 
 
        RNH 
           Mary had a 
           little lamb 
        Mary had a 
                  little lamb 

DESCRIPTION:

This statement reads the text displayed on the screen within the area defined by the given upper-left/lower-right coordinates into a string variable, str_var. The coordinates are specified by upper-left row, upper-left column, lower-right row, lower-right column. The statement returns a <LF> delimited string. No screen attributes are stored.

9.16.2 SET WINDOW AREA

FORMAT:


        SET WINDOW AREA row, col, row, col: DATA str_expr 

EXAMPLE:


        10  CLEAR 
        20  x$ = 'Mary had a' + chr$(10) + 'little lamb' 
        30  SET WINDOW AREA 6, 5, 7, 15: DATA x$ 
        40  END 
 
        RNH 
 
            Mary had a 
            little lamb 

DESCRIPTION:

This statement sets the screen within the area defined by the given upper-left/lower-right coordinates to the specified string. This is the mirror image of ASK WINDOW AREA row, col, row, col: DATA str_var.

9.16.3 ASK WINDOW: COLUMN

FORMAT:


        ASK WINDOW: COLUMN num_var 

EXAMPLE:


        10  CLEAR 
            PRINT AT 5,10:; 
        20  ASK WINDOW: COLUMN cur_col 
        30  PRINT 'Cursor is at column'; cur_col 
        40  END 
 
        RNH 
        Cursor is at column 10 

DESCRIPTION:

This statement returns the current column of the cursor's position.

9.16.4 SET WINDOW: COLUMN

FORMAT:


        SET WINDOW: COLUMN num_expr 

EXAMPLE:


        10  CLEAR 
            PRINT AT 5,10:; 
        20  SET WINDOW: COLUMN 4 
        30  PRINT 'Hi!' 
        40  END 
 
        RNH 
           Hi! 

DESCRIPTION:

This statement positions the cursor at the num_expr column within the current row.

9.16.5 ASK | SET WINDOW: CURRENT

FORMAT:


        ASK WINDOW: CURRENT str_var 
        SET WINDOW: CURRENT str_var 

EXAMPLE:


        10  CLEAR 
            PRINT AT 1,20, UNDERLINE: 'Sample screen' 
        20  DO 
              LINE INPUT 'Name', AT 5,1, LENGTH 30: name$       
              IF  _BACK  OR  _EXIT  THEN  EXIT DO 
              IF  _HELP  THEN 
                ASK WINDOW: CURRENT old_w$ 
                CLEAR AREA BOX: 1, 5, 10, 50 
                PRINT AT 3, 10, REVERSE: 'This is some help' 
                DELAY 
                SET WINDOW: CURRENT old_w$ 
                REPEAT DO 
              END IF 
        30  END DO 
        40  END 
 
        RNH 
 
            +--------------------------------------------+ 
            |                                            | 
            |    This is some help                       | 
            |                                            | 
        Name|                                            | 
            |                                            | 
            |                                            | 
            +--------------------------------------------+ 
 
 
                        Press the RETURN key to continue 


Previous Next Contents Index