Beta 10: Substring out of range in MID$
There's a slight problem with the code that corrects Mid$ expressions that would go out of range, in CEvents.m, expSys_MID. (For example: Mid$("Notenoughletters", 6, 999)) The code looks like it's trying to prevent the length parameter of Mid$ reading past the end of the string, but ends up with a negative length instead, which causes the same problem.
I think that the issue is just a missing "return" after the check for length being below or equal to 0. This works:
Code:
if (start<0) start=0;
if (start+len>l) len=l-start;
if (len<=0)
{
[getCurrentResult() forceString:@""];
return;
}
Re: Beta 10: Substring out of range in MID$
I just wanted to bump this back up again, as I exported anew with beta 15 and had to go in and change this again in CEvents.m (expSys_MID, expSys_LEFT, expSys_RIGHT)
Re: Beta 10: Substring out of range in MID$
Corrected! Thank you very much. If you have some other bugs trhat you have corrected for me, do not hesitate 8-)!
Re: Beta 10: Substring out of range in MID$
My knowledge of Objective-C is rudimentary at best, but I will do what I can ;)