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



Am 21.10.2021 um 03:29 schrieb Roger Harman <roger.harman@xxxxxxxxxxx>:

I understand the thought behind this but you're asking the next programmer to decipher a completely foreign (to them) syntax.
I do, however, use a named constant (QT) for quotes like yours, but I think that's pretty mainstream.

I really don't understand the difficulty being expressed over concatenation.

It’s not about difficulty, but think about a very long dynamic SQL string:

#sql = 'select …. +
from table +
where {column1name} = ''{column1val}'' +
order by {column1name}’;

It’s IMHO easier to read and understand than:

#sql = 'select …. +
from table +
where ' + %trim(column1name) + ' = ''' + %trim(column1val) + '‘' +
order by ' + %trim(column1name;

Just as a short example - now extrapolate that to a 52 line long complex SQL with CTE’s and something more.

The thing is, you don’t have to break the string a thousand times, and why not allow the normal RPG BIF’s inside the interpolation chars, like in

string = '….. {%char(%elem(array))} ….‘;

This would make it even more flexible.

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.