× 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 5/18/2015 5:49 PM, John Yeung wrote:

But to really Do It Right, I think you have to write your own comment
parser. It's definitely a shame, since everyone is having the same
thought: The editor component has already highlighted the comment, so
it has already done the work of figuring out what's a comment and
what's not; if only we could leverage that instead of re-engineering
it.

Cross-posted to WDSCI-L.

RDi already exposes whether the line is a comment or not. Here are some
examples:

* Strip Out the Mailing Zip
query elementClasses
elementClasses COMMENTS commentOnly Fixed

C EXSR GETMZIP
query elementClasses
elementClasses CONTROL Fixed

C IF *IN95 = *OFF
95 on = EOF/NO = MAT
query elementClasses
elementClasses COMMENTS CONTROL Fixed

// U1 - get additional looser match counts
query elementClasses
elementClasses COMMENTS commentOnly Free

if *inu1;
query elementClasses
elementClasses CONTROL Free CSpec

exec sql
select
(cursor here) count(*) -- count
into :foundE
from sometable
where match = 'F';
query elementClasses
elementClasses COMMENTS SQL Free CFreeSQL forwardLink backwardLink


It is therefore already possible to identify lines which are entirely
made of comments as well as lines which have right side comments.
Knowing that, a plugin could exclude the comment-only lines thusly: set
excludedClasses commentOnly Once excluded, a findText could then search
only the 'code' lines. This would still have false positives with right
hand comments, but a plugin could handle those as a special case. Wrap
the plugin inside something which iterates through a list of
tabs/members/filters and the general case is solved. For RPG.

And if I were any sort of a Java programmer I'd do it.


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.