I just had a look at this, to see how Tom Conley had implemented user-defined highlighting (using the USRHILIT REXX panel-exit) for non-ISPF supported languages, and I've made a suggestion to make a change that may make it easier to keep the various keyword and colouring REXX stems easier in sync. In essence, I'm replacing the

kw.     = 4

kw.1    = ' ALLOCATE '
kw.2    = ' BDAMQSAM '
kw.3    = ' BUNDLE '
kw.4    = ' CAPS '

atr.1   = 'DDDDDDDD'
atr.2   = 'DDDDDDDD'
atr.3   = 'DDDDDD'
atr.4   = 'DDDD'

clr.1   = 'RRRRRRRR'
clr.2   = 'RRRRRRRR'
atr.3   = 'RRRRRR'
clr.4   = 'RRRR'

with

kw.  = -1
atr. = -1
clr. = -1

and just the kw.x'es above and start the remainder of the code with

do ! = 1 by 1 while kw.! \= -1
  if atr.! \= -1 then                            /* already user-set */
    atr.! = translate(strip(kw.!), 'DDDDDDDDDDDDDDDDDDDDDDDDDDDDDD',,
                                   'ABCDEFGHIJKLMNOPQRSTUVWXYZ_-12')
  if clr.! \= -1 then                            /* already user-set */
    clr.! = translate(strip(kw.!), 'RRRRRRRRRRRRRRRRRRRRRRRRRRRDDD',,
                                   'ABCDEFGHIJKLMNOPQRSTUVWXYZ_-12')
end

I'm five-nines certain that this will be slower than the direct assignments (there are 295 keywords for SQL), but it will/should/might make maintaining them a bit easier, and it will definitely reduce the size of the code.

I've also replaced his bracket/brace highlighting code with code I use in my EHIxxx execs in CBT Tape 769, basically storing attributes to be used in a stem (starting at stem.0) and just using the // (modulo) operator, without a "if rem = 0 then rem = 5" follow-up, which Tom has already commented on with a "hbcolor.0 as other than the number of stems in hbcolor offends my sensibilities, so I'll have to give that one some thought ;-)"

A follow-up email to him also suggested, as yet not tested, that his way of highlighting "superfluous" closing brackets/braces will be incorrect when the opening bracket/brace is off-screen, as USRHILIT, unlike ISPF HILITE, only looks at the on-screen data.

But returning to the kw./atr./crl. stems, I seem to remember a discussion in a grey past on the long gone MVSHELP.COM forum that multiple assignments can be made really, really fast by using "parse", like Dough Nadel himself does in his code to add highlighting to SDSF, i.e.

parse value '0 R' with jclwords.0 jcolor. jlen.

By stringing all keywords together with suitable separators, a single statement could initialise the whole "kw." stem, and four more statements could initialise the "atr." and "clr." stems. (Yes four, it's left to the reader to figure out the two non-"parse" ones)

Would this be faster? I'd would appreciate it if someone could give it a try, as this is a panel-exit that's invoked every time a user presses Enter!

Robert

PS: And lastly, given that ISPF seems to have been more-or-less abandoned by IBM in favour of "whiter and shinier" "alternatives", wouldn't it make sense to engage Share and Guide into possibly convincing IBM to open(ish)-source it? Or do what they did with JES3, if there's anyone up to it?
--
Robert AH Prins
robert.ah.prins(a)gmail.com
The hitchhiking grandfather - https://prino.neocities.org/
Some REXX code for use on z/OS - https://prino.neocities.org/zOS/zOS-Tools.html

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to