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



I've encountered an error on a V4R5 machine with the %scan
bif that doesn't appear to happen on V5R2 and functions as
I would assume it would.

Here's the example:
eval string = 'thisisatest'
eval j = %scan('test':string:10)

Notice that the start position plus (10) the length of the
lookup string (4) is longer than the string I am scanning
(11) (this is where the problem seems to lie)

Now, I get the following error on V4R5:
Length or start position is out of range for the string
operation.

In V5R2 I simply get 0 for j and things work fine which is
how I assumed it would work.  

I have made sure the starting position isn't more than the
length of the string being scanned... it seems when the
starting position plus the length of the lookup string is
longer than the string to scan it throws this error.

Is this correct behavior, or is the behavior from V5R2
correct?  If V5R2 is correct, is there a PTF to fix V4R5?

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.