Page 1 of 1
[Done] BindVariableEvent()
Posted: Wed Jul 04, 2018 3:19 pm
by falsam
I wonder if that request wouldn't be stupid!!
BindVariableEvent() to redirect any variable change (
Integer, String, Array, Structure, List, Map ...) to a procedure.
Code: Select all
Define a
BindVariableEvent(a, @onChange())
Procedure onChange()
Debug a
EndProcedure

Re: BindVariableEvent()
Posted: Wed Jul 04, 2018 5:05 pm
by NicTheQuick
That is not possible at runtime because there are no interrupts you can attach to a single memory location. And if there would be an extra thread which is continuously watching that specific memory location you would have high CPU usage and you could also miss some events, e.g. the variable is toggling very fast between 0 and 1.
However I think it could be possible with "Runtime" variables but maybe this is not what you want. It would make anything slower because every write access to the variable would need more instructions than usual.
Re: BindVariableEvent()
Posted: Wed Jul 04, 2018 5:14 pm
by falsam
Thank you for the precision of this answer. My request was stupid. I did a comparison with the gadget IDs.