Sign up on the Revelation Software website to have access to the most current content, and to be able to ask questions and get answers from the Revelation community

At 14 APR 1999 09:12:05PM Dale Walker wrote:

Would like to know how to have a symbolic field evaluate data and if the data exceeds specs present the answer in a blinking color of my choice otherwise present the data in a normal color.


At 15 APR 1999 02:46AM Warren wrote:

Where do you want the color to display, during an RList report to the screen or in a WINDOW entry form?

If in RList create a symbolic that tests for your parameters and calls a subroutine to set the colors.

If in a WINDOW entry form, either do a user conversion or a post-prompt check.

Setting colors is no problem print:

ESC:'C':bgcolor:fgcolor

For the color combos you can use the following insert I created for Revelation F/G:

* * PROGRAM ID : COLOR.DEF * SHORT NAME : * PROGRAMMER : WARREN AUYONG * COPYRIGHT : WARREN AUYONG 1984 * Terms of license: you may freely incorporate any or all of this code * into any Revelation ™ application, regardless of intent of use * so long as this copyright and terms of license are included that code * Revelation is a trademark of Revelation Technologies, Inc. Bellevue, WA

*

    EQU BLACK TO CHAR(0)
    EQU BLUE TO CHAR(1)
    EQU GREEN TO CHAR(2)
    EQU CYAN TO CHAR(3)
    EQU RED TO CHAR(4)
    EQU MAGENTA TO CHAR(5)
    EQU YELLOW TO CHAR(6)
    EQU WHITE TO CHAR(7)
    EQU RED TO CHAR(4)
    EQU MAGENTA TO CHAR(5)
    EQU YELLOW TO CHAR(6)
    EQU WHITE TO CHAR(7)
    EQU GRAY TO CHAR(8)
    EQU IBLUE TO CHAR(9)
    EQU IGREEN TO CHAR(10)
    EQU ICYAN TO CHAR(11)
    EQU IRED TO CHAR(12)
    EQU IMAGENTA TO CHAR(13)
    EQU IYELLOW TO CHAR(14)
    EQU IWHITE TO CHAR(15)
    EQU ATR TO CHAR(27):'C'
    EQU BRDR TO CHAR(27):'B'
    NORM=ATR:BLACK:WHITE:BRDR:BLACK

* THE FOLLOWING ARE SET BY THE SET-COLOR VERB (V54)

    DFLTCLR=@COLOR
    RV=@COLOR
    HI=@COLOR
    RV.HI=@COLOR

So to print Green on Yellow the RBasic statement would be:

PRINT char(27):'C':char(6):char(2):'This is Green on Yellow'

Remember you have to set the BGC & FGC back to the defaults. These can be found in the @ENVIRON.SET system variable. See the INCLUDE record ENVIRON.CONSTANTS for the position of the default colors. See also Tech Bulletin #4 "R/BASIC - Video Attributes in AREV" and TB#63 "R/BASIC - Modifying Environmental Parameters in @ENVIRON.SET"

To set blink on add 8 to the BGC, e.g.:

PRINT char(27):'C':char(14):char(2):'This is blinking Green on Yellow'

If you use my code from above you can save yourself some grief. Example:

PRINT ATR:YELLOW:GREEN:'This is Green on Yellow'

I'll leave it up to you to add the equates for blinking colors.


At 15 APR 1999 03:12AM Warren wrote:

Whoops! I left out that some common color attributes are defined in the system variables @ATRBT.PTR and @ATRBT. Do a print @ATRBT.PTR for the mnenomic tags that ARev has defined. The first seven fields are Normal, Reverse, Highlight, Blink, Reverse Blink, Underline and Underline Blink. Using these system variables you could for example print blink yellow on blue thus:

Locate 'B' in @ATRBT.PTR using @FM setting PSN then

 print @ATRBT:

end

Locate 'YOB' in @ATRBT.PTR using @FM setting PSN then

 print @ATRBT:

end

 print 'This should be blinking Yellow on Blue'

To change color attributes dynamically in a WINDOW you probably have to fiddle with the AREV.COMMON / WINDOW.COMMON value SI. See the include LCPOSITIONS for the layout of this variable.


At 16 APR 1999 11:02PM Dale Walker wrote:

Thanks Warren.

Dale

View this thread on the forum...

  • third_party_content/community/commentary/forums_nonworks/0a94137f806530c08525675400069994.txt
  • Last modified: 2023/12/28 07:40
  • by 127.0.0.1