unrecognised character instead of Line break??

Ask a Question related to Macromedia Director Lingo, Design and Development.

  1. #1

    Default Re: unrecognised character instead of Line break??

    I had the same problem. Windows & Mac use different linebreaks.

    Windows needs a pair of numToChar(13) and numToChar(10) to recognize as
    RETURN.
    That is to say: it needs linefeed AND carriage-return.


    You can use my script to clean up your text before writing it to a
    textfile:

    yourFieldText = member(yourFieldName).text
    textToWrite = cleanOutput(yourFieldText)

    ------------------------------------------------
    -- convert field text so that notepad can read it correctly

    on cleanOutput oldText
    CRLF = numToChar(13) & numToChar(10)
    newText = ""
    repeat with n = 1 to the number of lines in oldText
    if n = 1 then
    set newText = line n of oldText
    else
    set newText = newText & CRLF & line n of oldText
    end if
    end repeat
    return newText
    end
    -------------------------------------------------

    chris



    On Sat, 6 Dec 2003 01:27:47 -0800, Ramesh <zobble@hotmail.com> wrote:
    > Hi,
    >
    > I am working on a file in director, where the content is coming from a
    > flash file which is embedded in the flash file.
    >
    > I am storing the value in the textbox named TextHolder by using the
    > following code.
    > member("TextHolder").text= getVariable( sprite "SuccessMeter" ,
    > "mytextvalue" )
    >
    > The value coming from the flash has line breaks. It shows perfectly
    > right in the Flash as well as in the Director TextBox.
    > But when i store the values of the textbox of Director to a external Txt
    > file, it puts unrecognised character in place of the line break. The
    > file is no more readable by flash.
    >
    > I need to replace the unrecognised character with a line break. Please
    > Help!!
    >
    > If someone can give me a sample file or a link where i can get more
    > info.. it will be great help.
    >
    > Thanks in advance,
    > Gunjan
    >
    Christian Grass Guest

  2. Similar Questions and Discussions

    1. line break
      I can't seem to get the line break to work in Contribute, so when I hit SHIFT + ENTER, it still gives a Paragraph tag. According to the help, it...
    2. Forced line break changes previous line endings
      Gang-- Give this script a try. It's quite experimental (i.e., use at your own risk), but in my tests it actually works to "freeze" the line...
    3. How to write a page break character.- one more question
      Hi, I have one more requirement, The last STATUS which occurs just prior to the file end should not be followed by a page break character. How...
    4. How to write a page break character.
      Hi, I want to search for the word "status" in a group of files in a directory and replace it with "status\n^L" where ^L is a page break...
    5. Invalid character instead of Line break??
      you might hae to replace return chars numToChar(13) with linfeeds numToChar(10)
  3. #2

    Default Re: unrecognised character instead of Line break??

    I had the same problem. Windows & Mac use different linebreaks.

    Windows needs a pair of numToChar(13) and numToChar(10) to recognize as
    RETURN.
    That is to say: it needs linefeed AND carriage-return.


    You can use my script to clean up your text before writing it to a
    textfile:

    yourFieldText = member(yourFieldName).text
    textToWrite = cleanOutput(yourFieldText)

    ------------------------------------------------
    -- convert field text so that notepad can read it correctly

    on cleanOutput oldText
    CRLF = numToChar(13) & numToChar(10)
    newText = ""
    repeat with n = 1 to the number of lines in oldText
    if n = 1 then
    set newText = line n of oldText
    else
    set newText = newText & CRLF & line n of oldText
    end if
    end repeat
    return newText
    end
    -------------------------------------------------

    chris



    On Sat, 6 Dec 2003 01:27:47 -0800, Ramesh <zobble@hotmail.com> wrote:
    > Hi,
    >
    > I am working on a file in director, where the content is coming from a
    > flash file which is embedded in the flash file.
    >
    > I am storing the value in the textbox named TextHolder by using the
    > following code.
    > member("TextHolder").text= getVariable( sprite "SuccessMeter" ,
    > "mytextvalue" )
    >
    > The value coming from the flash has line breaks. It shows perfectly
    > right in the Flash as well as in the Director TextBox.
    > But when i store the values of the textbox of Director to a external Txt
    > file, it puts unrecognised character in place of the line break. The
    > file is no more readable by flash.
    >
    > I need to replace the unrecognised character with a line break. Please
    > Help!!
    >
    > If someone can give me a sample file or a link where i can get more
    > info.. it will be great help.
    >
    > Thanks in advance,
    > Gunjan
    >
    Christian Grass Guest

  4. #3

    Default unrecognised character instead of Line break??

    Hi,

    I am working on a file in director, where the content is coming from a flash file which is embedded in the flash file.

    I am storing the value in the textbox named TextHolder by using the following code.
    member("TextHolder").text= getVariable( sprite "SuccessMeter" , "mytextvalue" )

    The value coming from the flash has line breaks. It shows perfectly right in the Flash as well as in the Director TextBox.
    But when i store the values of the textbox of Director to a external Txt file, it puts unrecognised character in place of the line break. The file is no more readable by flash.

    I need to replace the unrecognised character with a line break. Please Help!!

    If someone can give me a sample file or a link where i can get more info.. it will be great help.

    Thanks in advance,
    Gunjan


    Ramesh Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139