× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



On 7/23/2013 2:53 PM, Booth Martin wrote:
In furtherance of discussion:

I do not understand how to do the following, but it says it can be done,
so there must be a way.

In preferences, LPEX editor, RPG, one can change the foreground color,
background color, underline, squiggle, or outline of any defined line
style. For instance, one can have all comment lines with a red
foreground and a green background, and with a box around it.

Now, right after "Comment" in the list of line styles there is also
"Optional comment." I have never heard of an optional comment so I
looked it up.

Not sure where you looked; that might be interesting in itself :-) The
optional comment is an RPG III token that lives in columns 75-80. The
place where we used to punch the program name when we still used cards.

Apparently one can also define User Actions, and one can
define an "optional comment"??? At that point I ran out of ability to
understand what was going on. It appears one can define a new line
style, and define, in some detail, how it will appear.

'Line style' is tricky semantic territory. The parsers don't create a
line style, they break each line into individual fields. CL has a
different layout to RPG which in turn is different to RPGLE. You can
see the fields the parser recognises by going to Preferences > LPEX
Editor > Parsers > Parser Styles. In the case of RPG III, all the
fields are based on the specification (H, F, E, L, I, C, O) and the
column position with only a few exceptions like /COPY.

The important thing to understand is that the parser reads a line and
turns it into tokens. If you need to recognise a new token, you need a
new parser. Which you can write (in Java), but it's not as simple as a
few clicks in the Preferences. After you've written a new document
parser, you can then assign a style to the new token you've implemented
in the new parser.

Then one just
uses that line style and Bob's yer uncle, its available in your coding.

But I do not understand User Actions well enough to go farther. Perhaps
others can go farther with this?

User Actions are something altogether different to colourising code. A
User Action is a Java class that implements some sequence of editor
actions (cursor down, read a line, mark a block of text, etc.) Let's
say you wanted to rename a field by pressing Ctrl-R. There's no
existing editor action for that. You can scan and replace, but that
will alter comments, GOTO, TAG, BEGSR and procedure names. In order to
do that, you'd write some Java code that reads lines in the source,
scans to see if there's a field name in there (it needs to be smart
about it!) and changes the field name to the new name. Once you have
that class ready to go, you use User Actions to give it a name inside
Lpex. Once you have a name for it, you can assign it to a keystroke via
User Key Actions.

To hopefully summarise, User Actions are sequences you want the editor
to do, but haven't been supplied by IBM or Eclipse. User Key Actions
assign any action (yours, IBMs or Eclipse's) to a keystroke.

--buck

On 7/23/2013 1:06 PM, Buck Calabro wrote:
On 7/23/2013 1:14 PM, gevans@xxxxxxxxx wrote:
Using RDP 8.0.3.
I have a set of 3 lines of comments I would like to emphasize by
changing
their color from "comment green" to another color, preferably red. The
code is CLLE. Can
anyone tell me if this is possible and if so, how might I go about
making
this change?
... I know it's ugly. Sometimes thinking
aloud generates useful ideas.
--buck




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.