Mike,

Can't help from experience on large preferences records but, given that it's
just another database, there seems to be no reason not to use it.

According to the documentation on PrefGetAppPreferences:
The function returns the size of the actual preferences record if it exists
or noPreferenceFound (#defined as -1) if it does not.  
The prefsSize parameter is a pointer to the size of your buffer and is
necessary to prevent the function overflowing the buffer.
You need to check that the returned value is not greater than *prefSize
because, if it was, it would mean that the whole record could not be
returned because your buffer was too small.

While using it this way seems to work OK (with a fairly simple preferences
structure), I agree that the documentation is odd.  The version parameter in
PrefSetAppPreferences appears to have no purpose since it can't be
retrieved. And why does prefsSize need to be a pointer rather than a value?

Regards, Nick

-----Original Message-----
From: Mike Davis [mailto:[EMAIL PROTECTED]]
Sent: Monday, 2 August 1999 1:02
To: [EMAIL PROTECTED]
Subject: Unsaved Preferences - Size of


Is there a limit to the size of data that should be save in 
preferences?

I have an app where I want to save the state of that app.  It
will require up to 2k.  

Could that be saved in unsaved preferences?
Should it be saved in it's own DB?  

I already have an app DB for data.  What is benefit or penalty for 
saving that much data in unsaved preferences?

Now about PrefGetAppPreferences:
The description seems odd.

1) I think PrefGetAppPreferences returns version.

2) is prefsSize a pointer that is used by PrefGetAppPreferences to 
know how much to retrieve or is it a pointer where 
PrefGetAppPreferences puts the retrieved size. 

3) Then the docs say to check prefsSize against the returned value.  
That's apples and oranges thing.

Can someone explain this function and the checking necessary.  If I 
have a Prefs structure that is, say 1000 bytes and my unsaved 
Preferences (the acutal data previously saved) is only 500 bytes (as 
in you changed the struct size and already had unsaved prefs db), do
I have to check this?
--
-----------------------------------------------------------------
Discussion Group:        http://www.halcyon.com/ipscone/wwwboard/

Protect your constitutional rights. Your favorite one may be next!
-----------------------------------------------------------------

Reply via email to