-->
Page 1 of 1

MID()

PostPosted: Thu Dec 31, 2015 9:11 pm
by TassyJim
I have found an odd bug in MID()
I have been using MID(test$,x,99) to get the remainder of a string. As long as the second number is longer than the string length, it returns the string remainder successfully.
However, if the length of the resulting string is shorter than the variable name, the string is padded out with the variable name.
Code: Select alltest$ = "abcdefghifkl1234"
for n = 1 to 7
test$ = mid(test$,3,99)
serialprintln test$
next n
serialprintln ""
testlongname$ = "abcdefghifkl1234"
for n = 1 to 7
testlongname$ = mid(testlongname$,3,99)
serialprintln testlongname$
next n
end


It is really good to be able to get the remainder of the string without having to use LEN() first

Jim

Re: MID()

PostPosted: Thu Dec 31, 2015 10:00 pm
by Mmiscool
Posted a new build correcting this issue.

Re: MID()

PostPosted: Thu Dec 31, 2015 11:21 pm
by TassyJim
Thanks Mike,
It works well now.

Jim