View previous topic :: View next topic
|
Author |
Message |
Pedro
Global Moderator

Joined: 01 Sep 2006 Posts: 2600 Location: Silicon Valley
|
|
|
|
I will be speak at the SHARE conference next week in San Jose. Please attend my session:
Customizing the ISPF HILITE Command
Room: Room 213 Session Number: 20019
Monday, March 06, 2017: 3:15 PM - 4:15 PM
In this session, the speaker describes a programming technique that allows you to HILITE arbitrary text in the ISPF editor. The editor's normal highlighting can be extended to highlight additional text. For example, SQL can be highlighted, where language keywords are shown in a different color than punctuation, constants and names. Also covered is some background for the highlighting mechanism. (AD6) (ZOSP1) |
|
Back to top |
|
 |
don.leahy
Active Member
Joined: 06 Jul 2010 Posts: 767 Location: Whitby, ON, Canada
|
|
|
|
I'd love to be there, as this is a topic that I have looked into myself, but with only limited success. But my employer doesn't like sending "application" people to SHARE.
I look forward to seeing the presentation slides after the event. |
|
Back to top |
|
 |
Pedro
Global Moderator

Joined: 01 Sep 2006 Posts: 2600 Location: Silicon Valley
|
|
|
|
I think anyone can join SHARE.ORG and download the presentation. However, they charge you to attend the conference. |
|
Back to top |
|
 |
don.leahy
Active Member
Joined: 06 Jul 2010 Posts: 767 Location: Whitby, ON, Canada
|
|
|
|
Yes, my employer, like many others, has a corporate membership so there was no cost for me to join. I frequently troll through the vast repository of information found on SHARE.ORG.
But as you say, actually attending a SHARE conference costs money. |
|
Back to top |
|
 |
Lynne
Active User

Joined: 15 Jan 2015 Posts: 107 Location: USA
|
|
|
|
Pedro wrote: |
I will be speak at the SHARE conference next week in San Jose. Please attend my session:
Customizing the ISPF HILITE Command
Room: Room 213 Session Number: 20019
Monday, March 06, 2017: 3:15 PM - 4:15 PM
In this session, the speaker describes a programming technique that allows you to HILITE arbitrary text in the ISPF editor. The editor's normal highlighting can be extended to highlight additional text. For example, SQL can be highlighted, where language keywords are shown in a different color than punctuation, constants and names. Also covered is some background for the highlighting mechanism. (AD6) (ZOSP1) |
Pedro, do you have the presentation notes/pdf/powerpoint for this? I could not find it online.
I am trying to define a Hilite Color profile for a type of file not defined in standard hilite profiles.
Thanks. |
|
Back to top |
|
 |
prino
Senior Member

Joined: 07 Feb 2009 Posts: 1318 Location: Vilnius, Lithuania
|
|
Back to top |
|
 |
Lynne
Active User

Joined: 15 Jan 2015 Posts: 107 Location: USA
|
|
|
|
I do not have the application to open an XMI file.
Don't they have something in a Word/powerpoint/pdf format? I've downloaded many SHARE presentations in these more common formats.
Thank you. |
|
Back to top |
|
 |
Pete Wilson
Active Member
Joined: 31 Dec 2009 Posts: 592 Location: London
|
|
|
|
Have fun Prino :-)
Always the same select few from my company that get to go...probably always will be |
|
Back to top |
|
 |
prino
Senior Member

Joined: 07 Feb 2009 Posts: 1318 Location: Vilnius, Lithuania
|
|
Back to top |
|
 |
enrico-sorichetti
Superior Member

Joined: 14 Mar 2007 Posts: 10891 Location: italy
|
|
Back to top |
|
 |
enrico-sorichetti
Superior Member

Joined: 14 Mar 2007 Posts: 10891 Location: italy
|
|
Back to top |
|
 |
Pedro
Global Moderator

Joined: 01 Sep 2006 Posts: 2600 Location: Silicon Valley
|
|
|
|
re: I am trying to define a Hilite Color profile
I am not sure my presentation covers 'profile' as you describe it. But you can create a custom EDIT/VIEW panel to do arbitrary highlighting.
Lynne, I sent you a private message asking for your email address. |
|
Back to top |
|
 |
Lynne
Active User

Joined: 15 Jan 2015 Posts: 107 Location: USA
|
|
|
|
I think that would meet my needs.
It is a file that is much used, but not a standard format. It would just really be nice if people could view it with a colors. kind of a really basic color scheme (like no color scheme) that goes on for pages and pages.... when it really has sections and a format.. just hard to decipher the way it displays. |
|
Back to top |
|
 |
Pedro
Global Moderator

Joined: 01 Sep 2006 Posts: 2600 Location: Silicon Valley
|
|
|
|
Lynne, I sent you a PDF file. |
|
Back to top |
|
 |
Lynne
Active User

Joined: 15 Jan 2015 Posts: 107 Location: USA
|
|
|
|
Thank you, Pedro. I appreciate it.
I was looking for a way to define a color profile for viewing a file, not a panel, if I am understanding your presentation. I just go to ispf VIEW command to view the file in my rexx. I was hoping to define a new HILITE profile to use for the files my ISPF application displays.
I looked up ISRPXASM, the ISPF user-customizable table, to see if I could add something there.. I figured out where it is on my system, but could find no instructions on how to define a new color profile.
but I will keep looking. Thanks anyway for taking the time to send me the pdf. |
|
Back to top |
|
 |
WilliamDownie
New User
Joined: 01 Jul 2020 Posts: 23 Location: UK
|
|
|
|
@pedro, @Lynne, I read with interest your discussion on the ISPF Editor's HILITE feature. I use a proprietary scripting language that is similar to REXX in structure, with a few differences. The main one being it is not mandatory to end a comment with a '*/'. Also, comments cannot span more than one line as they can in REXX.
this is valid:
Code: |
/* comment comment
/* more comment more comment
|
this is valid:
Code: |
/* comment comment */
/* more comment more comment */
|
this is not valid:
Code: |
/* comment comment
more comment more comment */
|
So if I select REXX to highlight the script, and it starts with a '/*', but it has no closing '*/' the entire script is highlighted as a comment.
@pedro - I read through your presentation on using a panel exit to amend the ZSHADOW variable. From what I can see this can't be used to implement a new HILITE language, rather it can be used to adjust shadow attributes on an individual screen.
@pedro / @lynne - have you found if there a way for a user to implement highlighting an unsupported language, or is this something that is carried out by IBM ? |
|
Back to top |
|
 |
prino
Senior Member

Joined: 07 Feb 2009 Posts: 1318 Location: Vilnius, Lithuania
|
|
Back to top |
|
 |
Pedro
Global Moderator

Joined: 01 Sep 2006 Posts: 2600 Location: Silicon Valley
|
|
|
|
re: adjust shadow attributes on an individual screen
I suppose I agree with you, but maybe you need to be more specific about your criticism. What do you mean by 'an individual screen'?
In my presentation, I provide an example that will:
1. highlight any SQL file you provide
2. any number of statements in the file
3. the shadow attributes are adjusted each time you scroll
That is, each screen presented is different and it will work; it is not an 'individual screen'.
The example was for highlighting of SQL keywords, but you should be able to modify it for your proprietary scripting language keywords.
It seems pretty flexible to me. The main drawback might be that you need to explicitly launch the whole thing.
Maybe what is needed is an initial macro that detects the language, allocates the right panels and exec and then seamlessly launches the editor again.
---
fyi. I retired several years ago and while I still try to be helpful, I am starting to forget stuff due to lack of not using it any more. |
|
Back to top |
|
 |
WilliamDownie
New User
Joined: 01 Jul 2020 Posts: 23 Location: UK
|
|
|
|
Hi Pedro,
Thank you for your response. Please don't think I was criticising your presentation, it's just that I don't understand how to add my own highlighting at the moment.
When I say 'an individual screen' I mean the panel exit references the ZDATA and ZSHADOW variables which represent the current screen. I thought I may need to know what has appeared on the previous screen. But after thinking more about it I don't think I do.
Would you suggest setting the 'Coloring' to 'Do not color the program'. I am presuming no highlighting will have been done and ZSHADOW will then be empty. The exit will then update ZSHADOW based on what is on ZDATA ?
I think using your SQL example and the PLI comments example (USRPLICM) I should be able to experiment with the panel exit. |
|
Back to top |
|
 |
Pedro
Global Moderator

Joined: 01 Sep 2006 Posts: 2600 Location: Silicon Valley
|
|
|
|
I no longer have ability to experiment, so some of this is conjecture.
I think the panel definition always has the ability to highlight, and it should still work for FIND and cursor location (maybe others).
You are right to be concerned about what has occurred in the lines above what you can see. As you noted, comments and strings can span multiple lines and when you can only examine the visible lines then it might lead to unwanted highlights.
In my presentation example, I rely on highlighting being turned on. In the hilite settings panel, language=automatic and coloring=color program. You may wish to rely on a language that is already similar to yours. You will need to experiment.
In that way, the ISPF highlighting manages the comments and strings that span multiple lines. We will not know where a comment starts, but because those lines have a particular highlight, we know that it is on. In the example, it only highlights language keywords that are currently the default color.
I think 'D' is the default color attribute in the panel. In the panel exit, the attr. stem has what I want the current highlight to be and the colr. stem has the highlight that I will change it to.
Code: |
/* Current New */
/* keyword Color Color */
/* -------- -------- ---------*/
ky.1 =' AND ' ; attr.1 =' DDD' ; colr.1 =' RRR'
ky.2 =' AS ' ; attr.2 =' DD ' ; colr.2 =' RR '
...
/* Process each keyword */
Do ix = 1 To ky.0
strt = 2
offset = 1
/* Do until no more instances of this keyword are found */
Do While (offset > 0)
offset = Pos(ky.ix, zdata ,strt)
If offset > 0 Then
Do
/* Change highlight if not already highlighted */
If Substr(zshadow,offset,Length(attr.ix)) = attr.ix Then
zshadow = Overlay(colr.ix, zshadow, offset, Length(colr.ix))
strt = offset + 1
End
End
End
|
note: I was blessed to have worked at IBM. I was able to convince my peer developers in QMF to provide an SQL editor in their product, using this method. |
|
Back to top |
|
 |
prino
Senior Member

Joined: 07 Feb 2009 Posts: 1318 Location: Vilnius, Lithuania
|
|
|
|
Pedro, and obviously all others in this thread,
Why don't you get Hercules and one of the many escaped-into-the-wild ADCD versions of z/OS, from 1.10, which I've been using since 2009, all the way up to 3.1, and you can try things at home. ;)
For what it's worth, your former colleague Doug Nadel produced something to highlight the SDSF panels, I'm not sure if I can post it here, and it would definitely require changes for newer, z/OS >= 2.1, versions of SDSF, but it could serve as a template to hilite non-ISPF supported languages. Decipher my signature, not that hard, to email me for a copy. |
|
Back to top |
|
 |
|