ReadLine extra characters "|"

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

  1. #1

    Default ReadLine extra characters "|"

    I'm trying to read from a text file on a PC and when I use ReadLine I get extra "|" characters at the beginning (and sometimes the end) of lines. How the heck to I get rid of these?

    Thanks for the help!
    - Lars


    _Lars_ webforumsuser@macromedia.com Guest

  2. Similar Questions and Discussions

    1. #26218 [Opn->Fbk]: mail() sends extra "RCPT TO: <>" to smtp host
      ID: 26218 Updated by: pollita@php.net Reported By: bzheng at us dot nomura dot com -Status: Open +Status: ...
    2. #26218 [Opn->NoF]: mail() sends extra "RCPT TO: <>" to smtp host
      ID: 26218 Updated by: iliaa@php.net Reported By: bzheng at us dot nomura dot com -Status: Open +Status: ...
    3. #26218 [Opn]: mail() sends extra "RCPT TO: <>" to smtp host
      ID: 26218 User updated by: bzheng at us dot nomura dot com Reported By: bzheng at us dot nomura dot com Status: Open...
    4. #26218 [NEW]: mail() sends extra "RCPT TO: <>" to smtp host
      From: bzheng at us dot nomura dot com Operating system: W2k server/IIS 5/PHP in CGI mode PHP version: 4.3.3 PHP Bug Type: ...
    5. mysterious module "Readline"??
      This is a multi-part message in MIME format. ------_=_NextPart_001_01C37C6B.38F7F528 Content-Type: text/plain; charset="iso-8859-1"...
  3. #2

    Default Re: ReadLine extra characters "|"

    This works, but it can't possibly be the right way to do this?!?

    firstString = readToken(myFile,RETURN,RETURN)
    trash = readChar(myFile)
    trash = readChar(myFile)

    secondString = integer(readToken(myFile,RETURN,RETURN))
    trash = readChar(myFile)
    trash = readChar(myFile)

    Yuck!


    _Lars_ webforumsuser@macromedia.com Guest

  4. #3

    Default Re: ReadLine extra characters "|"

    newLine = whatYouReadFromTextFile
    if newLine.char [1] = numToChar (10) then
    put empty into newLine.char [1]
    end if
    if newLine.char [newLine.char.count] = numToChar (10) then
    put empty into newLine.char [newLine.char.count]
    end if

    of course a possibly slower but more robust method would be to check each
    character

    When you read in each line just call it:

    newLine = whatYouReadFromTextFile
    newLine = CheckForLineFeeds (newLine)

    -- put this in a movie script
    on CheckLineForFeeds
    newLine = numToChar (10) & "sldkfj" & numToChar (10) & "skdjf"
    cnt = newLine.char.count
    noFeeds = FALSE
    repeat while noFeeds = FALSE
    feedPos = offset (numToChar (10), newLine)
    if feedPos > 0 then
    put EMPTY into newLine.char [feedPos]
    else
    noFeeds = TRUE
    end if
    end repeat
    return newLine
    end

    --
    Craig Wollman
    Word of Mouth Productions
    phone 212 724 8302
    fax 212 724 8151
    [url]www.wordofmouthpros.com[/url]
    "_Lars_" <webforumsuser@macromedia.com> wrote in message
    news:bmq45i$1a7$1@forums.macromedia.com...
    > I'm trying to read from a text file on a PC and when I use ReadLine I get
    extra "|" characters at the beginning (and sometimes the end) of lines. How
    the heck to I get rid of these?
    >
    > Thanks for the help!
    > - Lars
    >
    >

    Word of Mouth Productions 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