Highlighting Words in a File

We had a call from a user who was working on some date conversions in a program. He asked if there was a way to hilite the word "date" when listing a program. Told him that there is no Qedit function for this, but that he could get something similar with these simple command files:


parm string      {1 parameter - the word to be highlighted}
/cq \!string\ \Esc&dB !string Esc&d@\ @
This can be used multiple times to hilite different words ....

All hilites can be reversed with:


/cq \Esc&dB\ \\ @     {cha Esc&dB to null}
/cq \Esc&d@\ \\ @     {cha Esc&d@ to null}

When creating the command file, insert the "real" escape character with:
/set decimal on
/cha "Esc" '27 @

....Back to the Qedit Q&A Page