× 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.



I just wanted to pass on to the list a little knowledge about a really incredible tool called Eclipse Monkey. I think Buck first mentioned this many moons ago, but I just started playing with it myself. What it is, is a simple scripting utility for Eclipse which basically allows you to access the source inside an editor using JavaScript. In reality, it does a whole lot more than that, but this is one thing it does.

It's not particularly well documented, and the way it works is just this side of black magic (it exposes the inner workings of the workbench via JavaScript classes) but what it does, it does extremely well. Once I got the gist of the tool, I was able to create a very simple script which basically converted type "B" variables in D-specs to type "I".

The relevant code is here:

if ( (line.substring(17,19) == "D ") &&
(line.substring(51,52) == "B")) {
editor.applyEdit(offset + 51, 1, "I");
}


Basically, check for D-blank in position 6 and 7, and a B in position 40, and replace the B with an I. The offset of 11 accounts for the zero-based string position and the 12 prefix characters of line number and date.

Very, very, very cool.

Joe

As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.