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



On 2022-06-03 12:04 p.m., Vinay Gavankar wrote:
... Would it be more efficient to use %scan to find the start and end positions
and then %subst to extract the value, or use some sort of pointer code to
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 end
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.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.