SheerPower® 4GL
A Guide to the SheerPower Language


Previous Contents Index

ERROR Option

SheerPower displays a message for at least three seconds before clearing the message. When the ERROR option is used the following things occur:

FORMAT:


        MESSAGE ERROR: expr [; | , expr] 

EXAMPLE:

Example 7-47 ERROR option in MESSAGE statement

  print at 1,1: 
  input 'Enter your age': age$ 
  message error: 'Is this really your age?' 
  end
 
        
Enter your age? 99 
 
            Is this really your age?

DELAY Option

The DELAY option of the MESSAGE statement causes SheerPower 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, SheerPower increases the delay a little for lengthier messages.

FORMAT:


        MESSAGE DELAY: expr [; | , expr] 

EXAMPLE:

Example 7-48 DELAY option in MESSAGE statement

  z$ = 'This is a very, very, very, very, very, very long message' 
  message delay: z$ 
  message delay: 'Short message' 
  end
 
 
 
   This is a very, very, very, very, very, very long message
 
                         Short message

7.3 DELAY

FORMAT:


        DELAY [num_expr] 

EXAMPLE:

Example 7-49 DELAY statement

  print 'Waiting a bit' 
  delay 4.5 
  print 'Done' 
  end
 
        
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 SheerPower to pause for the specified number of seconds before continuing program execution. The numeric expression (num_expr) can be a whole number or a fraction. For example:


        delay 3.5 

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


                    Press the ENTER key to continue 

and waits for the user to respond.

If, at the "Press ENTER..." prompt, a user enters:

[Ctrl/Z] _EXIT is set to TRUE (1)
[esc] or UP-arrow _BACK is set to TRUE (1)
[Help] _HELP is set to TRUE (1)

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

7.4 CLEAR

The CLEAR statement can be used to clear the SheerPower 4GL screen (everything within the SheerPower 4GL screen) or to clear a specific area of the screen. CLEAR can be used to clear any rectangular area within the screen. This statement clears 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:

Example 7-50 CLEAR statement - clearing the screen

  clear
  input 'Please enter your name': name$ 
  print 'Hello, '; name$ 
  end
 
 
Please enter your name? Tester 
Hello, Tester 

DESCRIPTION:

CLEAR, by itself, clears all text from the screen. It removes any message text that is displayed within the screen.

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. The default setting for number of rows is 30.

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. The default setting of columns is 80.


                              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. SheerPower 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:

Example 7-51 CLEAR AREA

  clear area reverse: 5, 10, 11, 60 
  print at 7, 20: 'Cleared area is in Reverse video' 
  end
 
        
 
                  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
                 |                                                 | 
                     Cleared area is in Reverse video 
                 |                                                 | 
 
                 |                                                 | 
                  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 

CLEAR AREA allows the following attributes to be used when clearing an area: BOLD, BLINK, REVERSE. 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, and REVERSE 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:

Example 7-52 CLEAR AREA BOX - BOLD, BLINK, REVERSE attributes

  clear area box, bold: 5, 10, 11, 60 
  print at 7, 20: 'Inside the box' 
  print at 12, 1: 'Outside the box' 
  end
 
        
 
                 +-------------------------------------------------+ 
                 |                                                 | 
                 |         Inside the box                          | 
                 |                                                 | 
                 |                                                 | 
                 |                                                 | 
                 +-------------------------------------------------+ 
        Outside the box 


Previous Next Contents Index