This was a post from Usenet a few years back regarding how HILITE settings are saved within the ISPF profile variable called ZPLEX. I just thought it was sort of interesting.

>Hey Doug,
>
>When you go into 7.3, the contents of that variable [ZPLEX] look a little cryptic to
>say the least.  Now that we can all write user line commands, is that a
>variable that I could query to see the current Hilite "assumption"?  It
>would be nice to do some actions automatically based on whether I'm editing
>JCL, COBOL, REXX, DTL Source, etc...
>
>I know I could try and figure out what type of member I'm editing myself,
>but I'm notoriously lazy and would much rather do one VGET.
>

Unfortunately, that information isn't in the ZPLEX variable. The ZPLEX variable is just the colors and symbols that will be used for each token type in each language (see the DUMPVAR command on my web page to see its full contents).

There isn't a good way to get the language that ISPF is using to color with when HI AUTO is in effect. It isn't stored anywhere. It's figured out each time you press ENTER or scroll.

Additionally, there isn't anything like

         ISREDIT (XXX) = HILITE

to get the settings from the profile. I couldn't see the need for it really (and the current language isn't stored) so we never did it. I played around with looking at the profile variables (trial & error mostly), and found that something like the following will give you most of the HILITE line from the PROFILE command. These things are stored in the edit profile. Sorry, REXX is a bit clumsy for this, but if you stare at it long enough, it'll probably make sense.

You can probably figure the language out by looking at the 1st nonblank line in the data set. The rules ISPF uses are in the edit book. -Doug

/* REXX - Show HILITE status - Definitely subject to break at any time*/
/*                             ----------                             */
/*   This looks at extension variables zedpflg2 and zedpflg3 in the   */
/*   current edit profile.                                            */
/*   If language is AUTO, you can't tell what ISPF is assigning it to.*/

Address isredit 'MACRO'
Address ispexec 'VGET (ZAPPLID)'
Address ispexec 'TBGET 'zapplid'EDIT'
Say 'ZEDPFLG2 = 'zedpflg2',  ZEDPFLG3 = 'zedpflg3
zedpflg2=x2c(b2x(zedpflg2))    /* convert flag byte to binary */
zedpflg3=x2c(b2x(zedpflg3))    /* convert language byte to binary */
bits.   = ''
bits.32 = 'COLOR'
bits.16 = 'DOLOGIC'
bits.8  = 'IFLOGIC'
bits.4  = 'PAREN'
bits.2  = 'FIND'
bits.1  = 'CURSOR'
status  = ''
Do a=0 to 4
  ln=c2d(bitand(zedpflg2,d2c(2**a))) /* convert each bit to a number*/
  status=status bits.ln
End
langs='OFF AUTO ASM PLI COBOL PASCAL C BOOK REXX PANEL SKEL JCL DTL
       OTHER DEFAULT PLX IDL'
ln=c2d(bitand(zedpflg3,'0F'x))  /* mask off high order bits */
If '00'x=bitand(zedpflg2,'20'x) Then ln=0

Say space(word(langs,ln+1) status) /* show HILITE status */