× 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 12/20/2013 6:19 AM, Paul Bailey wrote:
Just to be clear, I'm not trying to force RDi on to my colleagues but when green-screen programmers of 20-30 years experience do adopt the new tool solely on my casual advice but then fall foul of such a critical bug as losing/misplacing source code changes then I feel a fool for promoting the tool. Happily, both programmers who suffered yesterday are (as I type) upgrading RDi to v9.0.1 and look like they will continue using it.

Those who try it generally go through the Phases of Software Change Grief.
1) Hate it. Why are they making me change?
2) Hate it. Why doesn't this behave exactly like the old stuff?
3) Hate it. There are so many bugs.
4) Hate it. Why do those twits in the support forum keep calling them
features?
5) Eh, it's not too bad. At least I can see more lines of code.
6) Hate it. Why did they have to come out with a new release? Now I
need to get used to the new UI!
7) GOTO 1. What's wrong with GOTO anyway...

(The SEU users who like to argue against RDi are looking a little smug today, though.)

See how smug they'll look when SEU throws the epileptic siezure inducing
screen as it tries to syntax check new SQL, CL and RPG syntax. Then
they'll be oh-so forgiving of these... trifles. :-)

I don't think I ever used the REXX macros in Code/400... what did you do with them then that would be useful in today's RDi?

Mostly I write macros as a substitute for regular expression replace.
But I had a bunch written to do things like generate common code
templates - subfile work, common key lists, various prototypes I use
often and the like. Things which made my life easier than trying to
find an example, copy it, modify it to suit the current program.

Rexx has several advantages for scripting an editor.
1) It is interpreted. Let's say I want to write a new macro that will
convert D specs to the new fully free dcl-s spec. I open a new Rexx
file on my local hard drive and start writing. Then I Alt-arrow to my
RPG program, Esc > fullyFree and watch it work. It needs help so I
Undo, alt-arrow, edit my macro and repeat. I get to develop and test in
the same editor.
2) Rexx was designed to be an editor extension language. It's easy to
hook Rexx into the Code editor.
3) The Code editor hooks are well documented and easy to implement.

Here's an example of a macro that I find useful. Imagine you're
reformatting some code because you want to make it easier to understand.
You use alt-s and alt-j to handle spreading it out across multiple
lines. Try this is RDi. Put the cursor on the O_INHERITMODE and then
alt-s and then immediately alt-j.

bufOutfd = open( ifsOutFile : O_WRONLY + O_CREAT + O_INHERITMODE +
O_TRUNC + O_CCSID
: S_IRWXU
: CCSID_UTF16BE);

You get O_INHERITMODE waaaay off to the right. If you actually want to
join the lines together, you are going to be mucking about with the
arrow keys to select the white space so you can delete it. Here's a
macro that does that for you.

/* 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 */

/* profinit.lxu */
/* assign alt-x to compress white space */
/* 'set action.a-x macro delWhite' */

/* 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

As you can see from the comment, I also loaded this into my editor
profile so it's assigned to a keystroke, but for infrequently used
macros, just invoke them via Esc > macroName > Esc.

Having done one Java action for RDi, I can tell you that it's
considerably more effort to test and debug something this simple in RDi
than it ever was in Code/400.

I'm not complaining, exactly. I'm still on Software Grief step 4 :-)
--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.