You are probably reading a PC text on a Mac. PC uses both CR and LF 
to mark the end of a line. Mac uses only CR, so the LF will be shown 
as an 'unprintable character' - a box.

You need to run the contents of your textData through a Find & 
Replace routine to delete the LFs.

Here's a fast and nice general F&R that I wrote a while ago (watch 
out for email introduced line breaks in the source!):

-----------------

on fAndR sourceText, findChar, replacement -- Fast F&R hack
   lenFindChar = length(findChar)
   lenSource = length(sourceText)

   repeat while TRUE
     theOffset = offset(findChar, sourceText)
     if NOT theOffset then exit repeat -- no more occurencies

     part1 = sourceText
     delete char theOffset to lenSource of part1 -- snip off the end
     sourceText = part1 & replacement & (char theOffset + lenFindChar 
to lenSource of sourceText)
   end repeat
   strippedText = sourceText
   return strippedText
end

-----------------

sourceText is your 'textData' string
findChar is the 'box character'
replacement is ""

-Andreas



>Hi All,
>
>I am reading a text file using File I/o. When i read it at the 
>beginning of each new line i am getting a Box type character. How
>can i remove it before placing it in a field. I know it is something 
>to do with the return character or something else.
>
>Thanks in advance.
>
>This code below is attached to the field sprite loading it.
>
>property pMember
>
>on beginSprite me
>  pMember = sprite(me.spriteNum).member
>  pMember.text = EMPTY
>end
>
>on loadInstructionsFile me, instFileName
>  pFullFileName = instFileName
>  filePointer = new(xtra "FileIO")
>
>  -- Open the file in reading mode
>  openFile(filePointer, pFullFileName,1)
>
>  -- read the file header
>
>  textData = readFile(filePointer)
>  pMember.text = textData
>  closeFile(filePointer)
>end
>
>
>
>
>_________________________________________________________________________
>Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
>
>
>[To remove yourself from this list, or to change to digest mode, go to
>http://www.penworks.com/LUJ/lingo-l.cgi  To post messages to the list,
>email [EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED])
>Lingo-L is for learning and helping with programming Lingo.  Thanks!]


[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi  To post messages to the list,
email [EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo.  Thanks!]

Reply via email to