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



Hi Bob,
Rob already gave you a working solution.
I like to use the memcpy function so I don't have to create ad hoc data
structures. To do this, /copy the memcpy prototype (you can get it for free from
my website, www.rpgiv.com/downloads) and then just call it to do the copy:

   memcpy(myArr : myTextField : %len(myTextField));

Only two things:
1) Make sure that the length you pass on the third parameter is not longer than
either of the two values (I wish RPG had a %min() built-in function!).
2) Make sure you pass the "address of" to the function. You can easily modify
memcopy to avoid %addr() if you want, but it's more flexible using %addr.


-Bob Cozzi
www.i5PodCast.com
Ask your manager to watch i5 TV



-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On
Behalf Of Bob Anderson
Sent: Monday, February 19, 2007 10:25 AM
To: RPG programming on the AS400 / iSeries
Subject: Moving Fields to an Array.

Good Morning,
        I am converting an older program to RPG IV Free and have run
into a problem.

I have a 256 Character Field that in RPG gets moved to an Array of 11
occurrences of 25 Characters.  This then is used to print the values 25
characters at a time.

As in 'This is some text that I want to split apart'  would end up as  
 (1) This is some text that I w
 (2) ant to split apart


Is The a way to do this in an Eval statement.  If I say Array = Text I
get
 (1) This is some text that I w
 (2)  

Where only the first occurrence is being filled in

Thanks in advance
Bob Anderson
IT Guy
Kent Sporting Goods
433 Park Ave. S
New London OH 44851
419-929-7021 x315
email: banderson@xxxxxxxxxxxxxxxxxxx
 


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.