03-30-2009 09:46 AM
Hi!
I use an event case structure, and one case handles two value change events. One is a button's, the other is a cluster of controls'.
I would like to distinguish, whether the source was the button, or one of the controls in the cluster, but i get back the new-val and old-val in a variant type.
How could i get the appropriate values back?
Thanks
Solved! Go to Solution.
03-30-2009 09:55 AM
03-30-2009 10:00 AM
Actually I could duplicate it, but i'd like to avoid it, because the code is pretty big... and if there is an option to handle multiple events, then it'd be nice, to work it out that way.
The cluster contains simple boolean and numeric controls, and the event case looks like this:
"Cluster_of_controls", "button" : Value Change
On the left side of the structure there is an EventSource input, but is only tells thet is was the application, or some external stuff, and not that wich control.
03-30-2009 10:16 AM
For this, you would use the "ctlref" event terminal, not the "newval".
If you only have two controls, create a control reference for one and compare it with the ctlref event terminal. If they are equal, that was the control, else the other one. Place the terminal of both controls inside the event to get the values of each.
(If you have more than two controls, create an array of control references and use "search array" for the ctrlref output)
If your controls have unique names, you could also use the ctlref to get the control label, for example.
03-30-2009 10:17 AM
You can figure out whether the cluster or boolean underwent the value change by using the "CtlRef" indicator on the left hand side of the event structure. Using a property node, wire the CtlRef (turqoise color). Then you can select to read the "Label.Text" property to find out which control had the value change in the form of a string.
Does this work for you?
03-31-2009 04:06 AM