INTOUCH® 4GL
A Guide to the INTOUCH Language


Previous Contents Index

$- characters

Prints a floating dollar sign. The dollar sign appears before the number. $- causes INTOUCH to print a minus sign before negative numbers and a space before positive numbers. The minus sign or space appears after the dollar sign and before the number.


        10  PRINT "1st  col 2nd  col" 
            PRINT USING "$-###.## $-###.##": 11.93, -1.93 
        20  END 
 
        RNH 
        1st  col 2nd  col 
         $ 11.93   $-1.93 

If your expression is too large to fit in a field, INTOUCH gives an exception.

6.1.11 Directives

The directives used with the USING option of the PRINT statement tell INTOUCH what to do with the text.

FORMAT:


        PRINT USING 'directive' : str_expr 

6.1.11.1 {UCASE}?

The UCASE directive converts the str_expr to upper-case characters.


        10  PRINT USING '{UCASE}?' : 'march' 
        20  END 
 
        RNH 
        MARCH 

6.1.11.2 {LCASE}?

The LCASE directive converts the str_expr to lower-case characters.


        10  PRINT USING '{LCASE}?' : 'MARCH' 
        20  END 
 
        RNH 
        march 

6.1.11.3 {HYPHEN}

The HYPHEN directive causes INTOUCH to suppress the hyphen character if it is the last non-blank character after the format is applied.


        10  PRINT USING '<#####~-####' : '92123' 
            PRINT USING '{HYPHEN}<#####~-####' : '92123' 
        20  END 
 
        RNH 
        92123 - 
        92123 

6.1.11.4 {DATE [argument]}?

Given a str_expr that contains a date in the format YYMMDD or CCYYMMDD, the DATE directive converts the str_expr to a default or specified, optionally-masked, date format.

These date arguments can be used: YMD, CYMD, MDY, MDCY, DMY, DMCY, DMONY, DMONCY, MONTHDY, MONTHDCY. If no argument is provided, the default is MDCY. (See FORMAT$(expr, str_expr) for examples of date argument usage.)

To format the resulting date, replace the ? with a print mask.


        10  PRINT USING '{DATE}?': '960401' 
            PRINT USING '{DATE DMY}?': '960401' 
            PRINT USING '{DATE DMCY}?': '960401' 
            PRINT 
            PRINT USING '{DATE MDY}?': '19960215' 
            PRINT USING '{DATE MDY}##/##/##': '19960215' 
            PRINT USING '{DATE MDCY}##/##/####': '19960215' 
        20  END 
 
        RNH 
        04011996 
        010496 
        01041996 
 
        021596 
        02/15/96 
        02/15/1996 

6.1.11.5 {ROTATE n}?

The ROTATE directive rotates the last n characters in a str_expr to the first position in the str_expr. Optionally, the resulting str_expr can be masked by replacing the ? with a print mask.


        10  PRINT USING '{ROTATE 3}?': '5552527800' 
            PRINT USING '{ROTATE 3}###~ ###~-####': '5552527800' 
            PRINT 
            PRINT USING '{ROTATE 5}?': 'TuneTommy' 
            PRINT USING '{ROTATE 5}#####~ ####': 'TuneTommy' 
        20  END 
 
        RNH 
        8005552527 
        800 555-2527 
 
        TommyTune 
        Tommy Tune 

6.1.11.6 {TIME}?

Given a str_expr containing a 4 digit time in HHMM or HH:MM format or a 6 digit time in HHMMSS or HH:MM:SS format, the TIME directive converts the str_expr to HH:MM AM/PM or HH:MM:SS AM/PM.


        10  PRINT USING '{TIME}?': '1022' 
            PRINT USING '{TIME}?': '19:45' 
            PRINT 
            PRINT USING '{TIME}?': '102255' 
            PRINT USING '{TIME}?': '19:45:36' 
        20  END 
 
        RNH 
        10:22 AM 
        07:45 PM 
 
        10:22:55 AM 
        07:45:36 PM 

6.1.11.7 {ZIPCODE}?

Given a str_expr containing a 5, 6 or 9 digit zipcode, the ZIPCODE directive converts the str_expr to an appropriate zipcode format.


        10  PRINT '5 character zipcode : '; 
            PRINT USING '{ZIPCODE}?': '92126' 
            PRINT '6 character zipcode : '; 
            PRINT USING '{ZIPCODE}?': 'K8A3P9' 
            PRINT '9 character zipcode : '; 
            PRINT USING '{ZIPCODE}?': '931327845' 
        20  END 
 
        RNH 
        5 character zipcode : 92126 
        6 character zipcode : K8A 3P9 
        9 character zipcode : 93132-7845 

6.2 Using the INTOUCH Screen

INTOUCH has several features that allow you to control the appearance of the screen. The FRAME ON and FRAME OFF commands discussed previously turn the INTOUCH frame on and off. The statements described in the following sections can be used, within your program, to manipulate the screen.

6.3 MESSAGE

The MESSAGE statement prints a message at line 23 (the default line) on the screen. When the INTOUCH frame is on, line 23 is within the lower frame.

FORMAT:


        MESSAGE [ERROR: | DELAY:] expr [; | , expr] 

EXAMPLE:


        10  CLEAR 
            PRINT AT 1,1: 
        20  DO 
              MESSAGE 'Enter EXIT to exit' 
              INPUT 'Please enter your name': name$ 
              IF  _EXIT  THEN 
                MESSAGE 'The End' 
                EXIT DO 
              ELSE 
                PRINT name$ 
                REPEAT DO 
              END IF 
            END DO 
        30  END 
 
        RNH 
        Please enter your name? 
 
                               Enter EXIT to exit       (first message) 
 
        Please enter your name? Tester 
        Tester 
        Please enter your name? exit 
 
                                    The End             (second message) 

DESCRIPTION:

INTOUCH uses the message line (defaults to line 23) to display messages and errors. You can use the MESSAGE statement to display your own messages and errors on this line.

When the INTOUCH frame is on, your messages will appear within the lower frame. The MESSAGE statement can print several items. Each item can be any INTOUCH numeric or string expression. Multiple items must be separated with a comma or a semicolon. The separator determines where the next expression will be printed.

Semicolons

Separating message items with a semicolon causes the items to immediately follow one another. When the items are printed, no spaces appear between the items.

Commas

Separating items with a comma puts a space between each item.

INTOUCH would display this message:


        MESSAGE 'number is', 123; 456; 789 

as:


        number is 123456789 

ERROR Option

INTOUCH displays a message for at least three seconds before clearing the message. When the ERROR option is used, INTOUCH rings the device's bell, purges typeahead and displays the message. (Typeahead is the feature that accepts characters typed ahead of the computer's request for input.)

FORMAT:


        MESSAGE ERROR: expr [; | , expr] 

EXAMPLE:


        10  CLEAR 
            PRINT AT 1,1: 
            INPUT 'Enter your age': age$ 
            MESSAGE ERROR: 'Is this really your age?' 
        20  END 
 
        RNH 
        Enter your age? 99 
 
 
                            Is this really your age?

DELAY Option

The DELAY option of the MESSAGE statement causes INTOUCH to set an automatic delay, giving the user time to view the message before clearing the message. Starting with a minimum delay of approximately three seconds, INTOUCH increases the delay a little for lengthier messages.

FORMAT:


        MESSAGE DELAY: expr [; | , expr] 

FORMAT:


        10  CLEAR 
            z$ = 'This is a very, very, very, very, very, very long message' 
            MESSAGE DELAY: z$ 
            MESSAGE DELAY: 'Short message' 
        20  END 
 
        RNH 
 
           This is a very, very, very, very, very, very long message
 
 
                                 Short message

6.4 DELAY

FORMAT:


        DELAY [num_expr] 

EXAMPLE:


        10  PRINT 'Waiting a bit' 
        20  DELAY 4.5 
        30  PRINT 'Done' 
        40  END 
 
        RNH 
        Waiting a bit 
        Done 

PURPOSE:

Use DELAY when you need to cause a timed delay before continuing program execution---for instance, to give the user time to read a message before clearing the screen.

DESCRIPTION:

DELAY causes INTOUCH to pause for the specified number of seconds before continuing program execution. The numeric expression, num_expr, does not have to be a whole number, you can use fractions. For example:


        DELAY 3.5 

If num_expr is omitted, INTOUCH prints this message at the bottom of the screen:


                    Press the RETURN key to continue 
and waits for the user to respond.

If, at the "Press RETURN..." prompt, a user enters:
[Ctrl/Z] _EXIT is set to TRUE (1)
\ or UP-arrow _BACK is set to TRUE (1)
[Help] _HELP is set to TRUE (1)

A DELAY that waits for the [Return] key can also be completed by a MOUSE click.

6.5 CLEAR

The CLEAR statement can be used to clear the INTOUCH screen (everything within the INTOUCH frame) or to clear a specific area of the screen. CLEAR can be used to clear any rectangular area within the frame. When the INTOUCH frame is off, the entire screen can be manipulated with the CLEAR statement. CLEAR always removes messages, even if they are in the frame. You can use this statement to clear the screen before executing code or printing information on the screen.

FORMAT:


        CLEAR [AREA [BOX] [, attr_list:] row_1, col_1, row_2, col_2] 

EXAMPLE:


        10  CLEAR 
            INPUT 'Please enter your name': name$ 
            PRINT 'Hello, '; name$ 
        20  END 
 
        RNH 
        Please enter your name? Tester 
        Hello, Tester 

DESCRIPTION:

CLEAR, by itself, clears all text from the screen. CLEAR does not remove the INTOUCH frame if the frame is on, however, it does remove any message text that is displayed within the frame. If the frame is on, INTOUCH positions the prompt within the frame.

AREA Option

The AREA option clears a specific section of the screen. The cleared area is rectangular in shape.

row specifies a vertical position on the screen. Rows are numbered sequentially from the top of the screen to the bottom. With the INTOUCH frame on, there are typically 19 rows. With the frame off, there are usually 24 rows (The number of rows can vary depending on the terminal type and setting.)

col specifies a column--a horizontal position on the screen. Columns are numbered sequentially from the first character position on the left of the screen to the last character position on the right of the screen. Usually there are either 80 or 132 columns (depending on the terminal setting).


                              columns    
                        /                 \
                       /                   \
                       1 2 3 4 5 6 7 8 9 ... 
 
    row 1 ------      | | | | | | | | | | | | | | 
                      --------------------------- 
    row 2 ------      | | | | | | | | | | | | | | 
                      --------------------------- 
    row 3 ------      | | | | | | | | | | | | | | 
 
        . 
        . 
        . 

Two coordinates must be specified. These coordinates mark opposite corners of a rectangular area. INTOUCH clears the rectangular area specified by these two coordinates. For instance, the statement CLEAR AREA 2,3,8,20 would clear a rectangular area:


    1st coordinate (2,3)   +----------------+ 
                           |                | 
                           |                | 
                           |                | 
                           |                | 
                           |                | 
                           +----------------+   (8,20) 2nd coordinate 

The first coordinate (2,3) indicates the upper-left corner. The second coordinate (8,20) indicates the lower-right corner.

FORMAT:


        CLEAR AREA [, attr_list:] row_1, col_1, row_2, col_2 

EXAMPLE:


        10  CLEAR 
            CLEAR AREA REVERSE: 5, 10, 11, 60 
            PRINT AT 7, 20: 'Cleared area is in Reverse video' 
        20  END 
 
        RNH 
 
                  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
                 |                                                 | 
                     Cleared area is in Reverse video 
                 |                                                 | 
 
                 |                                                 | 
                  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 

CLEAR AREA allows the following attributes to be used when clearing an area: BOLD, BLINK, REVERSE, UNDERLINE. Multiple attributes used in one statement are separated by commas.

BOX Option

The BOX option creates an empty box with a frame.

The BOLD, BLINK, REVERSE and UNDERLINE attributes can also be used with the BOX option. Separate attributes in one statement with commas.

FORMAT:


        CLEAR AREA BOX [, attr_list:] row_1, col_1, row_2, col_2 

EXAMPLE:


        10  CLEAR 
            CLEAR AREA BOX, BOLD: 5, 10, 11, 60 
        20  PRINT AT 7, 20: 'Inside the box' 
            PRINT AT 12, 1: 'Outside the box' 
        30  END 
 
        RNH 
 
                 +-------------------------------------------------+ 
                 |                                                 | 
                 |         Inside the box                          | 
                 |                                                 | 
                 |                                                 | 
                 |                                                 | 
                 +-------------------------------------------------+ 
        Outside the box 

6.6 OPTION COMMUNICATE ON | OFF

Some OpenVMS facilities can broadcast messages to your terminal. INTOUCH will trap those messages and display them within the message area. Broadcast messages (communications) will stay on the screen until another message of any type is displayed.

FORMAT:


        OPTION COMMUNICATE ON | OFF 

EXAMPLE:


        10  CLEAR 
            OPTION COMMUNICATE OFF 
            PRINT AT 1,1: 
        20  INPUT 'Enter your name': name$ 
            PRINT name$ 
            OPTION COMMUNICATE ON 
        30  INPUT 'Enter your name': name$ 
            PRINT name$ 
        40  END 
 
        RNH 
 
        Enter your name? Tester 
        Tester 
        Enter your name? 
 
 
           .New mail on node FAST from FAST::MOLLY        (12:01:08) 

PURPOSE:

Determines whether to display messages broadcast to the terminal.

DESCRIPTION:

The OPTION COMMUNICATE statement turns the display of messages ON or OFF. The default is OPTION COMMUNICATE ON. If there is a message (such as a mail message), INTOUCH displays it in the message area (at the bottom of the screen). If you enter OPTION COMMUNICATE OFF, INTOUCH will not display messages.


Previous Next Contents Index