Alert when custom properties value changed
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Alert when custom properties value changed
HI All,
I have n number of cards in my stack and each of the card having custom properties eg: x_value, y_value, focus_val these are same in all cards but the corresponding values might different, the defalt value is 0 when ever the values of x_value, y_value, focus_val changed, I want an alert message like "answer x_value, y_value, focus_val changed" please help me
I have n number of cards in my stack and each of the card having custom properties eg: x_value, y_value, focus_val these are same in all cards but the corresponding values might different, the defalt value is 0 when ever the values of x_value, y_value, focus_val changed, I want an alert message like "answer x_value, y_value, focus_val changed" please help me
--
Thanks
Shalu S
Thanks
Shalu S
Re: Alert when custom properties value changed
Hi Shalu,
put some SETPROP handlers, one for each property you want to "monitor", into your stack script like this:
The you will see this dialog everytime your scripts change this custom property of any card!
Tested and works!
Best
Klaus
put some SETPROP handlers, one for each property you want to "monitor", into your stack script like this:
Code: Select all
setprop x_value tValue
## To prevent recursion!
lock messages
set the x_value of the target to tValue
unlock messages
answer "The property x_value has been modified for" && the target
end x_value
Tested and works!
Best
Klaus
Re: Alert when custom properties value changed
Klaus beat be while i was investigating the subject
Here is the stack a made to learn how to do it. There is two setProp handlers for myProperty : one on the stack, and one on the top button.
The one on the button would get fired only when setting myProperty for this object, but the one on the stack would run when setting myProperty for any object on the stack.
Here is the stack a made to learn how to do it. There is two setProp handlers for myProperty : one on the stack, and one on the top button.
The one on the button would get fired only when setting myProperty for this object, but the one on the stack would run when setting myProperty for any object on the stack.
- Attachments
-
- setPropHandler.zip
- (812 Bytes) Downloaded 198 times
Re: Alert when custom properties value changed
Bonjour Ormente,
Best
Klaus
get used to it, i work with LC and its predecessors since 1999, so this is no wonderOrmente wrote:Klaus beat be while i was investigating the subject
Best
Klaus
Re: Alert when custom properties value changed
@Klaus: I'm allready used to it... and i love it!
I gave a short try to LC in 2014, but i'm just learning it "seriously" now. Trying to answer questions helps me to learnderstand better... and you helped me too, by giving me the idea to put two setProp handlers to see how such "layering" works. It's very interesting. Thanks.
I gave a short try to LC in 2014, but i'm just learning it "seriously" now. Trying to answer questions helps me to learnderstand better... and you helped me too, by giving me the idea to put two setProp handlers to see how such "layering" works. It's very interesting. Thanks.
Re: Alert when custom properties value changed
Avec plaisir, mon ami!
Maybe my advantage (in using LC) was/is that I have no training in any other (more or less) serious programming language!
But I am good at logics and languages, so I can use the english like syntax easily to do whatever I want to do
Maybe my advantage (in using LC) was/is that I have no training in any other (more or less) serious programming language!
But I am good at logics and languages, so I can use the english like syntax easily to do whatever I want to do
Re: Alert when custom properties value changed
many thanks to all for your wonderful responses
--
Thanks
Shalu S
Thanks
Shalu S