Thank you! I appreciate all the solutions :)
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Booth Martin
Sent: Thursday, October 03, 2013 12:31 PM
To: RPG programming on the IBM i (AS/400 and iSeries)
Subject: Re: Scan and Replace
fwiw, either of these two RPG solutions worked:
D wString40 s 40
D ds
D w40 40
D wArr40 1 dim(40) overlay(w40)
D wLen s 5s 0
....
// # 2
wString40 = '12 56 0123 5 7 9 8blanks';
dow %len(%trim(wString40)) <> wLen;
wLen = %len(%trim(wString40));
wString40 = %replace('': wString40: (%scan(' ': wString40)): 1);
enddo;
dsply wString40;
// # 3
clear wString40;
w40 = '12 56 0123 5 7 9 8blanks';
for wLen = 1 to %elem(wArr40);
if wArr40(wLen) <> *blanks;
wString40 = %trim(wString40) + wArr40(wLen);
endif;
endfor;
dsply wString40;
Result:
DSPLY 125601235798blanks
DSPLY 125601235798blanks
On 10/3/2013 8:47 AM, Kari Zeglin wrote:
I am a girl ;) Chuck is correct in what I was asking. Sorry if I had
confused anyone :)
--
Booth Martin
www.martinvt.com
(802)461-5349
Skype: booth.martin
As to Jesus of Nazareth...I think the system of Morals and his Religion, as he left them to us, the best the World ever saw or is likely to see; but I apprehend it has received various corrupting Changes, and I have, with most of the present Dissenters in England, some doubts as to his divinity. -- Benjamin Franklin
--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
http://archive.midrange.com/rpg400-l.
As an Amazon Associate we earn from qualifying purchases.