If I define a string with some contents, then try to take a slice of that string where the start position is one less than the end position, I get the empty string. If the end position is 2 or more less than the start position, I get the "unacceptable array index" error message.
For example:
Code: Select all
a$ = "1234567890"
b$ = a$(4 to 3): REMark This works
REMark c$ = a$(4 to 2): REMark This fails with an error.
Turbo 415 happily compiles this and gives the same result as in S*Basic, the assignment to b$ is the empty string.
I found this because of a bug in Structured SuperBasic 2.7.2b (my changes recently) which was barfing on some lines of a bit of code I was working on, but not on other similar lines. Turned out to be a string slice where the start and end differed by 1 and the start was higher than the stop. I'm working on a fix even as I type.
Can anyone else see this error in S*Basic?
Cheers,
Norm.