|
On Aug 22, 2020, at 12:48 PM, Jordan Waterhouse <JordanWaterhouse@xxxxxxxxxxxx> wrote:
I have been programming in RPG for over 40 years. It is hard to change sometimes when you are used to doing things a certain way. We have been slowly converting to free format and it is a bit of a learning curve but it is worth it. Once you start learning and using free format, it's great! It's a lot easier to program than fixed format. I would highly recommend it!
-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxxxxxxxx] On Behalf Of Jon Paris
Sent: Saturday, August 22, 2020 11:22 AM
To: RPG programming on IBM i <rpg400-l@xxxxxxxxxxxxxxxxxx>
Subject: Re: How to work with Arrays using positional RPG IV
Jordan has pointed you in the right direction - but why in the world are you restricting yourself to fixed format? Free-form calcs have been around for more that SIXTEEN (16) years!
<Heads for the corner sobbing quietly>
On Aug 22, 2020, at 11:18 AM, Patrik Schindler <poc@xxxxxxxxxx> wrote:
Hello,
information regarding traditional, positional RPG are getting scarce
in the net. So I opt to ask the community. Maybe some can remember how
to program positional? :-)
I'm parsing a file with 9 different types of line content. One of them contains words or phrases, separated by comma. Different amounts of comma, different length of strings.
I learned that I can get an array of comma positions with:
C ',':1 SCAN TEXTLINE KEYWORDS
TEXTLINE contains the input string (comma separated keywords/phrases). KEYWORDS should receive the comma positions from SCAN:
DKEYWORDS S 2S 0 DIM(250)
How to do I actually do this loop, the equivalent of a for-loop iterating through each entry of the array? How can I know how many elements are actually used in the hard coded, predefined limit of 250 elements, to stop processing after all elements are processed? And, how to reset the array to empty before the next line containing keywords is to be processed? I never worked with array in RPG IV.
Unfortunately, the ILE Reference PDF isn't that much helpful regarding my questions.
Pointers to statements or documentations are very welcome!
:wq! PoC
PGP-Key: DDD3 4ABF 6413 38DE - https://www.pocnet.net/poc-key.asc
--
This is the RPG programming on IBM i (RPG400-L) mailing list To post a
message email: RPG400-L@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe,
or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related questions.
Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com
--
This is the RPG programming on IBM i (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at https://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related questions.
Help support midrange.com by shopping at amazon.com with our affiliate link: https://amazon.midrange.com
--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related questions.
Help support midrange.com by shopping at amazon.com with our affiliate link: https://amazon.midrange.com
As an Amazon Associate we earn from qualifying purchases.
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.