User Tag List

Results 1 to 2 of 2

Thread: String parsing

  1. #1
    Clicker Multimedia Fusion 2

    Join Date
    Mar 2007
    Location
    I'm right here!!
    Posts
    305
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    String parsing

    Could anyone point me in the direction of a string parsing tutorial if there is one? I've looked at Popcorn's INI tutorial (nice by the way) but this is something slightly different.

    Here's what I want to achieve: I want to load a text file and parse different sections of it to different objects. Here's the text file:

    "You may now proceed either by turning right and trying the floor of the Shaitan room, or by turning left and following the passage, which bears right past two rooms labeled Asmodeus and Eblis and then rejoins the landing?
    @@
    Turn right?
    200
    turn left?
    272"

    The idea being I want to parse the paragraph "You may now..." to a Formatted object, the "Turn right?" and "Turn left?" to a listview with the idea being if the player clicked "Turn right?" another text file loads in with the filename '200'. If the player clicks "Turn left?" a text file with the filename '272' is loaded in and parsed in the same manner.

    Can anyone help or should I explain further?

  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: String parsing

    Basically you need to include a delimiter - a unique character or string of characters that separate the elements of your object. In your case at the moment, the delimiter is the newline character (which might mean that just loading the file into a List object would be an even easier way to do this).

    You can set the String Parser up to recognize a delimiter and to get the elements of a string individually once it's been split up. After you've got them you can send them where you want.

    My online scoreboard tutorial touches on using the String Parser in this way: http://www.clickteam.com/eng/resources/online_score/onlinescoreboards.html

Similar Threads

  1. String parsing issues
    By JIMJ316 in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 26th April 2012, 10:51 PM
  2. Parsing question...
    By MikeB in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 14th September 2008, 04:05 PM
  3. Enemy spawn saving with string parsing.
    By SEELE in forum File Archive
    Replies: 6
    Last Post: 4th May 2008, 07:59 PM
  4. Parsing
    By ayejes in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 31st March 2008, 07:32 AM
  5. Extensive String Parsing! Need help.
    By Conno in forum Multimedia Fusion 2 - Technical Support
    Replies: 20
    Last Post: 18th May 2007, 08:39 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
  •