Page 1 of 1

str2mat fencepost glitch?

Posted: Sat Oct 05, 2019 11:37 am
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

:arrow:

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

Re: str2mat fencepost glitch?

Posted: Tue Oct 08, 2019 6:32 am
by gordon
I regard this as a design flaw. I will file it as a bug report.