|
On 2022-06-03 12:04 p.m., Vinay Gavankar wrote:
...positions
Would it be more efficient to use %scan to find the start and end
and then %subst to extract the value, or use some sort of pointer code toend
go thru the string character by character to do my own search? Or use a
combination of both?
My first scan to find the start of the field is simple. But to get the
of field, I will have to do multiple %scans for each of the 3 possible
characters (unless I am missing something).
...
I would use %XLATE to get a temporary with all the 3 possible end
characters translated to the one of the end characters.
temp = %xlate(x'1d1e' : x'1c1c' : string);
And then use %SCAN on the temp string just looking for x'1c'. If you
need to know what actual end character it was, you still have the
original string.
Jon's idea to use %SPLIT sounds good too.
--
Barbara
--
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.