On Sat, 18 Aug 2018 at 03:11, Vernon Hamberg <vhamberg@xxxxxxxxxxxxxxx> wrote:
Y'all - the most recent versions of RDi do split the line at the cursor
when you press Enter - to get the previous behavior - to get a new line,
you press Ctrl-Enter.
That was very welcome, but there is a complex interaction between the
'line splitter' and 'SQL formatter' functionality that is not
immediately intuitive to me. Maybe the list can help. Here is some
source:
exec sql
declare fred cursor for
select *
from systables;
x = y + 500;
I've got it in an SQLRPGLE.
My Preferences in Remote Systems > Remote Systems LPEX Editor > IBM i
Parsers > ILE RPG > Free-Form SQL Formatting are simple. Everything
is unchecked except Automatic indentkeys (Filter on SQL).
In Remote Systems > Remote Systems LPEX Editor > IBM i Parsers > ILE
RPG > Key Behavior I have
Alt-S splits and shifts
Enter splits in free form
Automatic indent
Automatic closure of control block
Tab indents
In LPEX Editor > User Key Actions, I have nothing.
Now put the cursor on the '5' in 'x = y + 500;'
Press Enter.
In my window, the 500 moves down one line and is shifted to the left
so it lines up with the '=' sign above.
I rather like that
This works the same in Insert or Overstrike mode..
Now place the cursor on the 'c' in 'declare fred cursor for'.
Press Enter.
My editor gives me a new, empty line after 'declare fred cursor for'.
It behaves exactly like Ctrl-Enter in free-form calcs.
I'm not keen on that because in my head I think of SQL statements as
free-form calculations. RDi has a different opinion :-)
Try the same experiment using the numeric keypad Enter, and it's
different to each other yet again. This time the SQL spli/shifts but
the calcs split/shift/no indent. I'd be OK with any of these
behaviours if they were entirely consistent - if Main Enter always did
X and Numeric Enter always did Y.
You've been on the RDi road with me for a long time Vern, so I know I
don't need to go into the history of the thing. I have a hypothesis
that because RDi was born in the columnar age, grew into a teen in the
columnar age, and is now a college student in the emoji age, there are
more than a few internal RDi processes that simply assume columnar
code. As we find and report them to IBM, I'm sure they'll get
addressed. I've never been more optimistic about RPG and RDi in 30
years. It's a great time to be an RPG programmer.
As for my Microsoft colleagues ribbing me about this or that, well
that's what bonds us together as programmers. They have their own
complaints about their IDE. I truly feel for the RDi developers.
They're writing a thing for programmers. Speaking for myself, as a
programmer, I Could Do That Better Then Those Other Programmers Did.
I'm sure of that, regardless of how true it actually may be (spoiler:
not remotely true). Do doctors make the worst patients? Do
programmers make the worst IDE users? Hm.
--buck
As an Amazon Associate we earn from qualifying purchases.