User Tag List

Results 1 to 4 of 4

Thread: String Tokeniser

  1. #1
    Clicker Multimedia Fusion 2SWF Export Module
    Jacob's Avatar
    Join Date
    Jul 2007
    Location
    Second pixel to the right
    Posts
    3,208
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    String Tokeniser

    I have a string that goes in this format:

    X1,Y1;X2,Y2

    I also have a list with two options, which would be indexed 0 and 1.

    With the String Tokeniser I am trying to gather coordinates based on the list's value, so if the first option in the list is selected, I want it to set the X position of an object to X1 and the Y position of an object to Y1.

    My events are as follows:

    • [color:#FF0000]Start of Frame[/color]
      [color:#006600]Edit Box[/color] : Set text "256,128;128,96"
      [color:#006600]String tokeniser[/color] : Split string Edittext$( "Edit Box" ) with delimiters "," and ";" (2D)
    • [color:#FF0000]Always[/color]
      [color:#006600]Active[/color] : Set X position to Val(Element2D$( "String Tokeniser", 0, List Select( "List" )))
      [color:#006600]Active[/color] : Set Y position to Val(Element2D$( "String Tokeniser", 1, List Select( "List" )))


    Now, In theory this should work. Except it doesn't. If the list is set to 0 then it does, but not if it is 1.

  2. #2
    Clicker Multimedia Fusion 2SWF Export Module
    Jacob's Avatar
    Join Date
    Jul 2007
    Location
    Second pixel to the right
    Posts
    3,208
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: String Tokeniser

    Nevermind, Eliyahu helped me fix it on GameBuilder</subtle advertising>

  3. #3
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module
    Eliyahu's Avatar
    Join Date
    Oct 2007
    Location
    Seattle, WA
    Posts
    1,523
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: String Tokeniser

    And for anyone interested, the solution was:

    Switch the delimiters so ";" was X and "," was Y, then change the positioning accordingly.

  4. #4
    Forum Moderator

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export ModuleInstall Creator Pro
    nivram's Avatar
    Join Date
    Jul 2006
    Location
    Bandon, Oregon
    Posts
    6,773
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)

    Re: String Tokeniser

    Thanks for sharing the solution Eliyahu.

    Marv
    ​458 TGF to CTF 2.5+ Examples and games
    http://www.castles-of-britain.com/mmf2examples.htm

Similar Threads

  1. Find String in String issues
    By DistantJ in forum Android Export Module Version 2.0
    Replies: 2
    Last Post: 13th February 2013, 12:35 PM
  2. String splitting with string parser
    By Sejez in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 5th February 2013, 05:31 AM
  3. Unable to change a string with the list obect if string contains three periods in row
    By redpandagames in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 4th January 2013, 03:01 PM
  4. Using String Parser to check for any punctuation in a string
    By Apex in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 18th May 2012, 11:03 PM
  5. [BUG] String object does not retain its string
    By mobichan in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 16th April 2011, 11:18 PM

Posting Permissions

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