str2mat fencepost glitch?

Information and discussion about BR error codes.

Moderators: Susan Smith, admin

John
Posts: 554
Joined: Sun Apr 26, 2009 8:27 am
Location: West Orange, NJ
Contact:

str2mat fencepost glitch?

Postby John » Sat Oct 05, 2019 11:37 am

:?: 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
John Bowman

gordon
Posts: 337
Joined: Fri Apr 24, 2009 6:02 pm

Re: str2mat fencepost glitch?

Postby gordon » Tue Oct 08, 2019 6:32 am

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


Return to “Error Codes”

Who is online

Users browsing this forum: No registered users and 1 guest

cron