Hi Joe,
On 28 Mar 2008, at 19:27, Joe Strout wrote:
> I don't recommend that. PStrings are an old Mac OS 9 thing; they
> aren't particularly encoding-savvy, and of course they don't support
> strings greater than 255 bytes (that's bytes, not characters).
>
> The problem you're seeing is no doubt that ReadPString, being a
> legacy function only intended for reading old Mac OS 9 files (which
> used WorldScript rather than Unicode), has not properly defined the
> encoding of the string. You could correct this with DefineEncoding,
> but I recommend you quit using PStrings for your own data entirely.
Ah, right. Didn't know that. I just opened the BinaryStream example
that was shipped with RB - having never worked with files in RB before
- and that's what they used in the example.
What should I use instead for storing text? I don't see a ReadString
or WriteString in the help file or the contextual helper - or should I
just avoid BinaryStreams for preference files and just use a text file?
All the best,
Mark.
------------------------------------------------------------
RB Class
"Killer Tool Bar" - theme-based x-platform toolbar
www.rbclass.com
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>
|