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



Before posting this, I did some quick research and did not find anything about this issue........forgive me if it is well known and I simply overlooked it!

Had an interesting problem this morning and I was surprised that it did not throw an error........

Wrote a short test program to illustrate the issue -

0001.00 d pos1 s 1 0 dim(20)
0002.00 d pos2 s 2 0 dim(20)
0003.00 d string s 20a
0004.00
0005.00 c eval string=
0006.00 c '1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|'
0007.00
0008.00 c '|' scan string pos1
0009.00
0010.00 c '|' scan string pos2

Here's what pos1 shows -

POS1(1) = 2.
POS1(2) = 4.
POS1(3) = 6.
POS1(4) = 8.
POS1(5) = 0.
POS1(6) = 2.
POS1(7) = 4.
POS1(8) = 6.
POS1(9) = 8.

And here's what pos2 shows -

POS2(1) = 02.
POS2(2) = 04.
POS2(3) = 06.
POS2(4) = 08.
POS2(5) = 10.
POS2(6) = 12.
POS2(7) = 14.
POS2(8) = 16.
POS2(9) = 18.


See the problem? POS1 is wrong because it only is only 1 position. The values are getting truncated and SCAN is not throwing an error.

POS2 is correct. It has 2 positions.

Has anyone seen this before?

Thanks,

Joe




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.