str2mat fencepost glitch?

Information and discussion about BR error codes.

Moderators: Susan Smith, admin

Post Reply
Posts: 555
Joined: Sun Apr 26, 2009 8:27 am

str2mat fencepost glitch?

Post by John »

:?: Is this a glitch in str2mat?
:shock: I'd expect this line to return 12 items, but it only returns 11. :idea: There's a workaround commented out on line 5


Code: Select all

1 dim line$*512
2 dim item$(0)*40
3 line$=',2,3,4,5,,7,8,,10,,'
4 str2mat(line$,mat item$, ',')
5 ! str2mat(line$&' ',mat item$, ',')   !  this is a workaround
6 pr 'udim=';udim(mat item$)
7 for x=udim(mat item$)-3 to udim(mat item$)
8   pr 'item$(';x;')=';item$(x)
9 nex x
John Bowman
Posts: 358
Joined: Fri Apr 24, 2009 6:02 pm

Re: str2mat fencepost glitch?

Post by gordon »

I regard this as a design flaw. I will file it as a bug report.
Post Reply