I asked how to programmatically delete an app preference (like an
orphaned one).

I was told to "write 0 to it".  I don't believe this is enough
information.  

Write 0 to where.  There is already a 0 in the first location, so that
can't be what is required.

And would the MemMgr know this space was now being made available, if I
just wrote 0 to it?  Using what command?

What is the proper way to programmatically delete an orphaned
preference so that 1) the preference record does not show up in either
Saved or Unsaved preference DB and 2) the memory used is made available.

THINKING OUT LOUD:
Wait a minute.  "Saved Preferences" is just a database.  The specific
preference that I might want to delete is just a record.  So can I just
use one of the DmDelete commands to delete a specific preference?

I think I might have referred to Preferences as a Database but it is a
record within another DB, right?

But when I look at one of my DBs (using RsrcEdit), I see that my record
is listed as a record number followed by the size and the record is just
memory space filled with my data.  I access them with DmGetRecord().

But when I look at the preferences, I see that this is a list of
resources rather than records.  Hmmmm..  For each record there is
a type and a length.  

Do all records of any database, have a type associated with them, or
do only resources records have a type?

There is also a command: DmFindResourceType that looks like it returns
the Index for a particular resource.  Can I just use this index (say 3),
to delete Saved Preference record 3 using DmDeleteRecord?  I hesitate
to just try it; might be too catastrophic:-)
END OF THINKING OUT LOUD:

Where is the format for the Saved Preferences DB defined?  For instance,
when I create my own DB, I don't see 'type' in my individual records.
But, the Saved Preferences DB apparently has a 'type' for each record
but doesn't seem to be a part of the record data.  Where is this format
documented?

Thanks, sorry for rambling on.

----------------------------------------------------
Shoot-to-Win

Protect the 2nd Amendment
----------------------------------------------------

Reply via email to