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



This honestly isn't that hard - Birgitta had a very easy and complete answer. The best advice I have is, keep it simple - but what is simple may depend on you.

You are dealing with continuation - I think Peter's example with 3 apostrophes will not work - the third apostrophe closes off the string.

Either put single quotes at the beginning and end of each line, with a plus sign at the end, or have the single quotes only at the beginning and end of the string. In either case, embedded quotes need to be doubled - that's all there is to it - same thing we have had to do for 25 years and more, actually.

I go back and forth between including the quotes on each line or not - often because I need to concatenate variables in the middle, which need the quotes to terminate each segment of the final string.

Perhaps look up "continuation" in the RPG Reference to get the true answers to your questions here. It starts at about page 247 of the 6.1 manual in the US version.

HTH
Vern


On 2/15/2011 8:27 AM, David FOXWELL wrote:
Hmm, not as easy as that it would seem. Lot's of different answers with different numbers of quotes around the apostrophe!
I don't like the QUOTE constant, it just makes it less readable. But I suppose it saves one from having to remember how many quotes to use!

Charles, RTM would have sufficed thanks. What does "A hyphen (-) indicates continuation is in the first available position in the continued field " mean?
What's the continued field?

Birgitta's translation is clearer : the text continues with the next (blank) character in the next row.
Surely, that would be the character in column 8?

Thanks all.



-----Message d'origine-----
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] De la part de Colpaert, Peter
Envoyé : mardi 15 février 2011 14:46
À : RPG programming on the IBM i / System i
Objet : RE: Eval variable = long text

David,

Easy peasy:

/free
MyVar = 'This is a sentence of around ' +
'130 characters containing ' +
'apostrophes an'''all';
/end-free

HTH,

Peter Colpaert
Software Engineer - PLM Development Team Philips Consumer Luminaires
Tel: (+32) 3/459 13 17
Fax: (+32) 3/450 74 33
Address: Industrieterrein Satenrozen 11, 2550 Kontich, Belgium
Email: Peter.Colpaert@xxxxxxxxxxx


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-

As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.