Page 1 of 1

Deleting Custom Property Sets

Posted: Wed Nov 25, 2009 4:51 pm
by SirWobbyTheFirst
I have a stack which uses Custom Property Sets to keep track of the users data whilst they are logged onto the application. It creates custom property sets often (And quickly i may add.) and i was wondering if there was to delete just a selected set, for example if the parameter pSetName had the users name in and i wanted to delete that without touching the other sets.

How would i go about doing this? I know setting the custom property sets value for the stack deletes them all but i dont want to do this. Thanks michael.

Re: Deleting Custom Property Sets

Posted: Thu Nov 26, 2009 11:59 am
by Janschenkel
I'm a little confused. Do you have a custom property set per user, or one custom property set, where each user has an element? In other words, do you want to delete the whole set, or an individual property in a set?

Getting rid of the whole set is quite easy:

Code: Select all

command DeleteCustomPropertySet pObject, pSet
   local tSets
   put the customPropertySets of pObject into tSets
   set the wholeMatches to true
   delete line lineOffset(pSet,tSets) of tSets
   set the customPropertySets of pObject to tSets
end DeleteCustomPropertySet
Getting rid of an individual element is not too complicated either:

Code: Select all

command DeleteCustomPropertyFromSet pObject, pSet, pProperty
   local tPropertiesA
   put the customProperties[pSet] of pObject into tPropertiesA
   delete variable tPropertiesA[pProperty]
   set the customProperties[pSet] of pObject to tPropertiesA
end DeleteCustomPropertyFromSet
HTH,

Jan Schenkel.

Re: Deleting Custom Property Sets

Posted: Thu Nov 26, 2009 12:11 pm
by SirWobbyTheFirst
The stack creates an individual property set, what i want is for the application to be able to delete an individual property set, like how revolution does in the Custom Properties part of the Inspector.

For example: Say there are three users logged on, Admin, User1 and User2. Under the CustomPropertySets property it will list Admin, User1 and User2. Now say for example that User1 clicks logoff, I want the application to delete the Custom Property Set without effecting the other two.

Im sorry i was in a rush to right the first message and paragraph so i apologize if it boggled you mind. Beleive me it boggled my mind when i re-read them. :oops:

Re: Deleting Custom Property Sets

Posted: Thu Nov 26, 2009 6:13 pm
by Janschenkel
It's quite alright - it happens to me all the time, sometimes I realize it mid-sentence and can correct it; at other times, I get confused looks and only then reliaze I have to do it all over again :-)
Anyway, I think my previous answer will help you get things sorted out.

Jan Schenkel.