Hi Jacob, Interesting problem. Do you have a sample project showing the issue?
May a debugger problem is involved? Did you check outputting PosChar in an Editfield and see if there is a difference to what the debugger shows? Does it make a difference when you use a For-Next Loop from 1 to chunk.len? best regards Thomas -------- Original-Nachricht -------- Datum: Mon, 14 Aug 2006 10:37:33 +0200 Von: Jacob Palme <[EMAIL PROTECTED]> An: REALbasic NUG <[email protected]> Betreff: Problem reading file containing the "\'" character > I have a text file in ISO Latin 1 format with DOS > Linebreaks. To be able to access the file randomly, in > order to do a binary search in a sorted list of words. I > open it as a BinaryStream. I then read a chunk of > characters with > > Chunk = MyBinaryStream.Read(Position,Encodings.ISOLatin1) > > I then scan through the Chunk backwards with > > For Pos = Chunk.Len DownTo 1 > PosChar = Chunk.Mid(Pos,1) > > This works OK until the character "'" is encountered in the > chunk. From then onwards, Poschar becomes an empty string > even though Chunk looks quite all right when I look at its > value using the debugger. > > What is happening? > > Example of a chunk causing this problem: > > "a > aah > aahed > aahing > aahs > aal > aalii > aalii's > aaliis > Aaliyah > Aaliyah's > a" > -- > Jacob Palme <[EMAIL PROTECTED]> (Stockholm University and KTH) > for more info see URL: http://www.dsv.su.se/jpalme/ > _______________________________________________ > Unsubscribe or switch delivery mode: > <http://www.realsoftware.com/support/listmanager/> > > Search the archives of this list here: > <http://support.realsoftware.com/listarchives/lists.html> _______________________________________________ Unsubscribe or switch delivery mode: <http://www.realsoftware.com/support/listmanager/> Search the archives of this list here: <http://support.realsoftware.com/listarchives/lists.html>
