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 a way to delete just a selected set, for example if the parameter pSetName had the users name in and i wanted to delete the set which matched that set without touching the other sets in the stack.
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. Any help would be much appreciated. Thanks Michael.
Deleting Custom Property Sets
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- VIP Livecode Opensource Backer
- Posts: 246
- Joined: Tue Jun 30, 2009 11:15 pm
Re: Deleting Custom Property Sets
Dear Michael,
To delete custompropertyset setX, use the following code:
Best,
Mark
To delete custompropertyset setX, use the following code:
Code: Select all
on mouseUp
put the custompropertysets of this stack into mySets
filter mySets without "setX"
set the custompropertysets of this stack to mySets
end mouseUp
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
-
- VIP Livecode Opensource Backer
- Posts: 246
- Joined: Tue Jun 30, 2009 11:15 pm
Re: Deleting Custom Property Sets
Thank You Mark, your starting to become a visionary to me. I'd been experimenting across Thursday and Friday and the code I came up with used a hidden field but the example you've shown will enable me to get rid of the field and shorten down the script. So thank you very much. This was my original code, which did work but I'm kinda like a perfectionist and that I always like to minimise the code size.
Thanks, Michael.
Code: Select all
Function DeleteCustomPropertySet pStack,pSetName
Put The CustomPropertySets Of Stack pStack Into Field "Property Sets"
Find pSetName In Field "Property Sets"
Delete The FoundLine
Set The CustomPropertySets Of Stack pStack To Field "Property Sets"
End DeleteCustomPropertySet