User Tag List

Results 1 to 6 of 6

Thread: String Parser: finding Newline$ among other delimeters?

  1. #1
    Clicker

    Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCHTML5 Export ModuleiOS Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)Universal Windows Platform Export Module (Steam)
    ratty's Avatar
    Join Date
    Apr 2012
    Posts
    1,165
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)

    String Parser: finding Newline$ among other delimeters?

    I have a loop that runs through a Rich Edit, based on " " and NewLine$ being delimeters. It adds each element as a line in a list. In the end, I'm left with a list containing each word in the Rich Edit. The thing is, if there are any line breaks (Newline$) in that Rich Edit, the element count and the list line count are out of sync. To fix this, I need a blank line to be added into the list whenever NewLine$ delimeter is found. I can't seem to make this work. I'm questioning if NewLine$ doesn't work as a delimeter.

    Does anyone have ANY idea what could be done? This issue is causing me some major grief.

  2. #2
    Clicker

    Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleUnicode Add-onInstall Creator Pro
    StingRay's Avatar
    Join Date
    Nov 2006
    Location
    Austria
    Posts
    1,057
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    Do you have had luck or may a workaround for newline$ ?!?

  3. #3
    Clicker Fusion 2.5 DeveloperInstall Creator Pro

    Join Date
    Sep 2006
    Posts
    517
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi everyone,
    Be careful when using Rich Edit object, if you are enabling use of Rich Edit 2.0 library, newlines are encoded with only one character (CR) and not with two characters (CR + LF). It may be the reason why String Parser is not splitting the string properly.

    To ensure compatibility with most of input strings, it could be interesting to replace NewLine$ (which is CR + LF) to Right$(NewLine$,1) (which will be LF) and Left$(NewLine$,1) (which is CR) to Right$(NewLine$,1) (again LF character).
    ouly

    See http://en.wikipedia.org/wiki/Newline

  4. #4
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleSWF Export Module

    Join Date
    Jul 2006
    Location
    Norway
    Posts
    333
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Maybe try to use a linechange as the delimiter instead of NewLine$

    Try to copy this:

    "
    "

    And paste it in as a delimiter

    You can copy a newline character by going into notepad, writing something short in to lines and then copy it in to the expression editor and remove the letters.

    EDIT: when copying the newline posted above between the "", there might be a space there that you need to remove.

  5. #5
    Clicker

    Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleUnicode Add-onInstall Creator Pro
    StingRay's Avatar
    Join Date
    Nov 2006
    Location
    Austria
    Posts
    1,057
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    Ouly, you are absolutly right!!

    This would work on iOS for parsing a newline$ with StringParser:

    Right$(NewLine$,1)

  6. #6
    Clicker Fusion 2.5 DeveloperInstall Creator Pro

    Join Date
    Sep 2006
    Posts
    517
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    By the way, another option that may be interesting some times: String Parser seems to skip empty elements, therefore adding NewLine$, Right$(NewLine$,1) and Left$(NewLine$,1) as delimiters may produce the same result.

    Another thing: here I assume that NewLine$ is CR + LF. I don't have any experience with CF's exporters, it could not be the case on all platforms. In this case, it could be better to add sequences using chr$( "String Parser", 13) and chr$( "String Parser", 10). In addition, when using Unicode input strings, it could be even different and everything said about NewLine$ and its use may be unapplicable.

Similar Threads

  1. help with newline$ in string object
    By StingRay in forum iOS Export Module Version 2.0
    Replies: 0
    Last Post: 13th January 2014, 06:05 PM
  2. String, the length before a newline problem. Could use help :)
    By Radical in forum Multimedia Fusion 2 - Technical Support
    Replies: 9
    Last Post: 11th November 2013, 07:43 PM
  3. [BUG 256.34] newline$ char in String object
    By Olivier in forum Multimedia Fusion 2 - Technical Support
    Replies: 8
    Last Post: 18th February 2013, 06:27 AM
  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. String Parser or String Parser 2? Vitalized
    By DJ_Wild in forum Multimedia Fusion 2 - Technical Support
    Replies: 10
    Last Post: 5th September 2009, 10:12 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
  •