At 10:33 AM -0700 10/22/2001, Ben Rubinstein wrote:
>I want to add a few simple user-configurable (ie preference) options to my
>app, which is distributed as a standalone on both Mac and Windows.
>
>(I don't want it stored in the folder with the app). So on the Mac I need
>to find the standard preferences folder. I bet there's a way to do that...
>but I can't find it. On Windows, I need (I guess) to locate the Windows
>'system' folder (often, but not always, called "Windows"), and write an
>"xxx.ini" file there. Is there a way to locate the Windows system folder?
New in 1.1, you can use the specialFolderPath function. For Mac, use
specialFolderPath("Preferences"); for Windows, use
specialFolderPath("system").
For 1.0, I think you'd pretty much have to go with either an external, or
AppleScript (on the Mac side) and perhaps a registry setting (?) on the
Windows side.
>b) how to format it
I think any of the ways you note is fine. I myself think the cleanest
solution is probably to put a Preferences substack, holding the user
interface, in your standalone (with the default Prefs settings), and clone
it to a Preferences file in the appropriate location whenever you start up
and there's no Preferences file already there.
This way you don't have to parse a text file, you don't have to worry about
a user editing the file directly (and possibly corrupting it - i.e. you
don't have to do as much integrity checking on the data), and you don't
have to set up the current prefs in the UI every time you open the
Preferences window.
--
Jeanne A. E. DeVoto ~ [EMAIL PROTECTED]
http://www.runrev.com/
Runtime Revolution Limited - Power to the Developer!