Delete Custom Property
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Delete Custom Property
How do i go about removing a custom property
ive tried setting it to empty, setting it to false, using delete and using remove
ive tried setting it to empty, setting it to false, using delete and using remove
Re: Delete Custom Property
..........
Last edited by [-hh] on Wed Aug 13, 2014 4:10 pm, edited 1 time in total.
shiftLock happens
Re: Delete Custom Property
i dont get it. a custom property isnt a variable
if i type
then it will create a custom property in that stack called cMyProperty which can be called like
if i wanted to cleanup the custom properties im looking to delete some of them
if i type
Code: Select all
on mouseUp
set the cMyProperty of the stack "myMainStack" to "something"
end mouseUp
Code: Select all
answer the cMyProperty of the stack "myMainStack"
Re: Delete Custom Property
Look at this thread.
http://forums.livecode.com/viewtopic.ph ... ES#p107841
http://forums.livecode.com/viewtopic.ph ... ES#p107841
Re: Delete Custom Property
..........
Last edited by [-hh] on Wed Aug 13, 2014 4:10 pm, edited 1 time in total.
shiftLock happens
Re: Delete Custom Property
the code will totally clear out all of the customProperties i want to just remove 1 of them. It has to be done via script so doing it through the inspector is not an option
Code: Select all
set the customKeys of this stack to empty
Re: Delete Custom Property
Hi,
Try this
Best
Jean-Marc
Try this
Code: Select all
on delprop pVar
put the customkeys of this stack into myArray
delete variable MyArray[pVar]
set the customproperties of this stack to myArray
end delprop
Jean-Marc
https://alternatic.ch
Re: Delete Custom Property
..........
Last edited by [-hh] on Wed Aug 13, 2014 4:10 pm, edited 1 time in total.
shiftLock happens
Re: Delete Custom Property
is that to be run as a command or function?
never mind it worked like a dream
never mind it worked like a dream
Re: Delete Custom Property
..........
Last edited by [-hh] on Wed Aug 13, 2014 4:11 pm, edited 1 time in total.
shiftLock happens
Re: Delete Custom Property
Hi,
Jean-Marc's approach doesn't use offset and should therefore be much faster if you want to delete a large range of custom properties.
For the record, if you want to delete a key from a nested property, you don't need to use the customProperties property:
Kind regards,
Mark
Mark
Jean-Marc's approach doesn't use offset and should therefore be much faster if you want to delete a large range of custom properties.
For the record, if you want to delete a key from a nested property, you don't need to use the customProperties property:
but if you want to delete the property itself, here cProp, then you'll need the customProperties property.put the cProp of me into myPropArray
delete variable myPropArray["x"]
set the cProp of to myPropArray
Kind regards,
Mark
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
Re: Delete Custom Property
..........
Last edited by [-hh] on Wed Aug 13, 2014 4:11 pm, edited 1 time in total.
shiftLock happens
Re: Delete Custom Property
Hermann,
What do you mean with not-deleted?
Mark
What do you mean with not-deleted?
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
Re: Delete Custom Property
..........
Last edited by [-hh] on Wed Aug 13, 2014 4:11 pm, edited 1 time in total.
shiftLock happens
Re: Delete Custom Property
supposed when i want to alter the custom properties of an item i want to delete all of the properties then store the new ones. however if something is wrong with the new ones to store i want to halt whats going on... then put the original properties back in. i can put te properties back in by using set customKeys of me to cks but how can i get a full array of the customkeys of the property and its value to save then put it back in (hope that made sense)
example of what i mean if i have some customKeys set with values in ButtonA and this script is run when ButtonB is clicked
example of what i mean if i have some customKeys set with values in ButtonA and this script is run when ButtonB is clicked
Code: Select all
on mouseUp
put the customkeys of button "ButtonA" into cks
set the customKeys of the button "ButtonA" to empty
answer "keep properties? " with "Yes" or "No" titled "Delete properties"
if it = "Yes" then
set customKeys of button "ButtonA" to cks
end if
end mouseUp