Re: Idea submitted: Built in function to subset an array using a procedure to filter
Jon Paris <[email protected]>
| Newsgroups | gmane.comp.lang.as400.rpg |
|---|---|
| Message-ID | <[email protected]> |
Personally, I'd sort it to get the blanks together and then use the first one I found to quit the loop. Unless you need the original sequence for some reason, in which case a count would also need to be added to be able to re-sequence. Jon Paris [email protected] > On Nov 10, 2025, at 9:34 AM, David Gibbs via RPG400-L <[email protected]> wrote: > > On Tue, Nov 4, 2025 at 1:30 PM Glenn Gundermann <[email protected]> > wrote: > >> It sounds interesting. I'd like to know a real example of how you might >> use this. What project do you have that this would come in handy for? >> > > I can think of many situations where I've wanted to iterate through an > array only including specific elements. > > Right now I'm working on a situation where I need to process an array that > has blank elements that I don't need to process. > > Yes, I can test the element before processing it but, IMO, it would be > better to be able to get a subset of the array with the blank elements > excluded. > > david > -- > IBM i on Power Systems: For when you can't afford to be out of business! > > I'm riding in the American Diabetes Association's Tour de Cure to raise > money for diabetes research, education, advocacy, and awareness. You can > make a tax-deductible donation to my ride by visiting > https://mideml.diabetessucks.net. > > I may have diabetes, but diabetes doesn't have me! > -- > This is the RPG programming on IBM i (RPG400-L) mailing list > To post a message email: [email protected] > To subscribe, unsubscribe, or change list options, > visit: https://lists.midrange.com/mailman/listinfo/rpg400-l > or email: [email protected] > Before posting, please take a moment to review the archives > at https://archive.midrange.com/rpg400-l. > > Please contact [email protected] for any subscription related questions. > -- This is the RPG programming on IBM i (RPG400-L) mailing list To post a message email: [email protected] To subscribe, unsubscribe, or change list options, visit: https://lists.midrange.com/mailman/listinfo/rpg400-l or email: [email protected] Before posting, please take a moment to review the archives at https://archive.midrange.com/rpg400-l. Please contact [email protected] for any subscription related questions.