11-01-2022, 07:02 PM
(11-01-2022, 06:49 PM)johnno1956 Wrote: As to why the results seem to be 'reversed', cleverer people than I, would have to answer that one... But, just to point out a slight 'quirk' with Naalaa, as compared to most 'Basics', the 'right' command string index starts at zero. Most Basic's index start at one. I do not believe that this will fix your problem... I suppose it would just be FYI... I hope that you get the answer you are looking for...
Just to make sure I understand. Even if zero based, if you have:
s = right("abcdefghi", 2)
What would you expect s to be?
The 2 right-most characters would (to me at least) be "hi".
But if I run:
s = right("abcdefghi", 2)
wln(s)
I get: "cdefghi" - which is the right-most 7 characters. Hmm. Does right(s, n) start at n - counting from 0 from the left?
"a" is in position 0, "b" is in position 1, and "c" is in position 2.
Ok, maybe that is what it is doing.
So maybe not a bug, just the old "nut behind the wheel"
