Combine Button Events?
I have a number of Button Events that run the same code.
Currently I have them listed as:
Is there a way to combine all those button events or do a range?
Thanks
Currently I have them listed as:
BUTTON_EVENT[dvTP1,801]
BUTTON_EVENT[dvTP1,802]
BUTTON_EVENT[dvTP1,803]
BUTTON_EVENT[dvTP1,804]
BUTTON_EVENT[dvTP1,805]
BUTTON_EVENT[dvTP1,806]
BUTTON_EVENT[dvTP1,807]
BUTTON_EVENT[dvTP1,808]
BUTTON_EVENT[dvTP1,809]
BUTTON_EVENT[dvTP1,810]
{
//Do Script
}
Is there a way to combine all those button events or do a range?
Thanks
0
Comments
DEFINE_CONSTANT VOLATILE INTEGER btnABUTTONRANGE[] = {801, 802, 803, 804}; DEFINE_EVENT BUTTON_EVENT[dvTP,btnABUTTONRANGE]{ PUSH:{ doScript(GET_LAST(btnABUTTONRANGE)); } }This will call the function doScript with the parameter 2 in the case of button 802 being pushed.... define_variable devchan combinedControl = { {dev1, 1}, {dev1, 2}, {dev2, 1} } define_event button_event[combinedControl] { push: { // do stuff here } } ...