Buck,
Did you check into the Eclipse Monkey tool? I see that it is
now lagging development and possibly going to be obsolete soon but it
seemed simple enough. I never got very far other than a convert case
tool.
http://www.mcpressonline.com/programming/dev-tools/introducing-eclipse-m
onkey.html
You still need to learn some java scripting and DOM to be robust.
Thanks, Matt
-----Original Message-----
From: wdsci-l-bounces@xxxxxxxxxxxx [mailto:wdsci-l-bounces@xxxxxxxxxxxx]
On Behalf Of Buck
Sent: Tuesday, March 30, 2010 8:28 AM
To: wdsci-l@xxxxxxxxxxxx
Subject: Re: [WDSCI-L] LPEX Editor - Delete white space to the right of
thecursor
On 3/29/2010 2:42 PM, Duane wrote:
If I have a line that looks like the below, where the carrot is the
cursor):
Before - "Text to ^ edit."
After - "Text to edit."
The deleteWhiteSpace deletes all the white space between the two
string segments, which means I have to insert a blank space. Not bad in
this case, but when I want more than one space it starts getting more
cumbersome.
It's not Lpex because I'm too stupid to know how to do it in every
version of Lpex (not to mention that I'm on 7.0.0.8 and far, far behind
the rest of the universe due to cost concerns.)
I wrote a little CODE/400 macro to do this. I called it delWhite:
/* delete white space between words */
/* place cursor on line where white space is to be compressed out */
/* given 123 456 789 */
/* cursor ^ */
/* yields 123 456 789 */
/* pull the current line from the buffer */
'extract content'
/* where is the cursor? */
'extract cursorcol'
lineLen = length(content)
/* if cursor at end of line, no white space to compress */
if (cursorCol = lineLen) then return
/* split the line into two parts at the cursor */
rightLen = lineLen-cursorCol+1
left = substr(content, 1, cursorcol-1)
right = substr(content, cursorcol, rightLen)
/* reassemble the line, stripping off leading blanks from the right side
*/
work = left || strip(right,L,' ')
/* put the modified line back into the buffer */
'set content' work
return
Create a directory on your PC (I ingeniously call mine \buck), create a
new file in it called delWhite.lx CODE/400 will let you edit it by
clicking on it with Windows Explorer.
You'll need to enable macros (a one time process) by issuing the editor
command: extras on \buck
To execute this particular macro, position the cursor in the line, press
ESC and issue the command: macro delWhite Press ESC again and you're
back editing, with the spaces compressed out. That can get old fast, so
it can be assigned to a command key such as alt-x by issuing the editor
command set action.a-x macro delWhite
If you like it enough to use it a lot, you can create a profile, whereby
the assignment is done every time you start CODE/400. Create a
directory on your PC where you will store macros (I call mine
\buck\macros) and create a file named profint.lxu. Make the contents of
that file:
/* profinit.lxu */
/* assign alt-x to compress white space */
'set action.a-x macro delWhite'
None of that ESC command ESC nonsense this way.
An analysis of the macro shows how simple it is to extend CODE/400 to
perform chores that aren't already in the repertoire. It took me a half
hour to write and debug and to write up this email to describe it to the
list.
This probably doesn't help the OP but I have an ulterior motive: I would
like to see Rational expose at least 'set' and 'extract' to an external
scripting language. I'll stop the editorial here and note only that it
was very easy to create and test a Rexx macro / script and it's not at
all easy to do it in WDSC Lpex.
I would love nothing more than for someone to call me a blithering idiot
and show me an Lpex reference that gives me similar functionality.
--buck
As an Amazon Associate we earn from qualifying purchases.