User Tag List

Results 1 to 4 of 4

Thread: Beta 10: Substring out of range in MID$

  1. #1
    Forum Moderator Fusion 2.5 DeveloperHTML5 Export ModuleiOS Export ModuleSWF Export Module
    DavidN's Avatar
    Join Date
    Jun 2006
    Location
    Boston, MA, USA
    Posts
    4,044
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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;
    	}

  2. #2
    Forum Moderator Fusion 2.5 DeveloperHTML5 Export ModuleiOS Export ModuleSWF Export Module
    DavidN's Avatar
    Join Date
    Jun 2006
    Location
    Boston, MA, USA
    Posts
    4,044
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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)

  3. #3
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export Module
    Francois's Avatar
    Join Date
    Jul 2006
    Location
    Montpellier, France
    Posts
    6,920
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)

    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-)!

  4. #4
    Forum Moderator Fusion 2.5 DeveloperHTML5 Export ModuleiOS Export ModuleSWF Export Module
    DavidN's Avatar
    Join Date
    Jun 2006
    Location
    Boston, MA, USA
    Posts
    4,044
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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

Similar Threads

  1. Substring replace Object...
    By Earl in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 6th February 2019, 02:12 PM
  2. Trying to retrieve substring out of string?
    By brawltaunts22 in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 25th December 2010, 11:24 PM
  3. obtenir une substring
    By Sylnade in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 1st March 2007, 05:06 PM
  4. Substring Replace
    By LIJI in forum Released Extensions
    Replies: 0
    Last Post: 5th February 2007, 11:18 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •