0

I'm putting together a browsing/paging system for database lookup, and was wondering if there is a way to highlight output(or invert bg and fg colors) in the DISPLAY or possibly something that works similar to UNDERLINE, to use as the selection reticle for browsing.

Thanks.

Tom Bascom
  • 13,405
  • 2
  • 27
  • 33
Tanner Sorensen
  • 59
  • 1
  • 11

1 Answers1

1

The quick and easy way is something like this:

define variable x as character no-undo initial "abc123".

color display messages x.

display x.

pause.
Tom Bascom
  • 13,405
  • 2
  • 27
  • 33
  • In the UNIX environment, it highlights correctly, but it either covers up, or nulls out the text. What does the 'messages' do? Doesn't seem like it's a keyword, and I've never seen it before. – Tanner Sorensen Oct 08 '12 at 21:18
  • Holy crap, figured it out. You have to display out twice with the same fields you want written out. The first time with COLOR, and the second, normally, and you'll get your text on top of the colored display. Thanks a bunch for the jumpstart! – Tanner Sorensen Oct 08 '12 at 21:29
  • There are two different statements: COLOR which sets the color for elements of a frame (and takes either DISPLAY or PROMPT keywords to say when that color applies), and DISPLAY which actually puts it out there. I used MESSAGES as the example color because it is usually "reverse video" which seemed to be what you wanted. But if you have a color terminal and a proper PROTERMCAP entry you can use things like RED/WHITE instead ;) – Tom Bascom Oct 08 '12 at 21:47