PAINT

Redefine the paint character

 

USupported on Unix
VSupported on OpenVMS

 

xcall PAINT(paint_char)

Arguments

paint_char

An expression whose leftmost character will become the new paint character. (a)

Discussion

The PAINT subroutine changes the current paint character to another character.

Although you can substitute any character for the paint character, we recommend that you select a printing character.

When program execution begins, the paint character defaults to a blank. During program execution, you can use the %PAINT intrinsic function to obtain the decimal character code for the current paint character.

The paint character is completely ignored unless the FLAGS subroutine sets runtime option flag 4 or you set system option #5 with the DBLOPT environment variable to indicate that the program is communicating with a CRT-type terminal. When the CRT flag is set, pressing the Delete key (or its equivalent) during input deletes the most recently typed character and “paints” the position with the paint character. The cursor remains positioned at the deleted character. If the user presses Ctrl+U, the entire current line is deleted, every character of its contents is replaced with the paint character, and the cursor is positioned at the first character on the line.

When you call the PAINT subroutine, your program must initialize the appropriate input area to the correct paint character. The user then enters data over the paint characters. When the user deletes either a character or the entire line, Synergy DBL automatically repaints the deleted positions with the current paint character.

Examples

The example below enables CRT terminal mode by setting runtime option flag 4, sets the paint character to a period (.), and initially fills the input field with periods. The user types over the periods when entering input.

.define TTCHN   ,1
record
    input       ,a20

proc
    open(TTCHN, i, "tt:")
    xcall flags(4000, 1)                ;Enable CRT terminal mode
    xcall paint('.')                    ; and set paint character
    xcall fill('.', input)
    repeat
      begin
        display(TTCHN, "Name: ", input, $scr_mov(0,-10))
        reads(TTCHN, input)  [eof=done]
        forms(TTCHN, 2)
        display(TTCHN, "Press Enter to continue: ")
        reads(TTCHN, input)  [eof=done]
      end
done,
    stop
end