omron — Creating Buttons

Creating Buttons ; The status of a button event will be stored in event[0].; Look to see if that event was a button-up event. IF event[0] == btn.up THEN ; Check if the button-up event was within the button area ; The x location is in event[1], the y location in event[2] hit = (event[2] > 99) AND (event[2] 146) hit = hit AND (event[3] > 99) AND (event[3] 146) END UNTIL hit ; The code for reacting to a button press is placed here. This code will work for a single button but will become very unwieldy if several buttons are used.

In the case of several buttons, you should place the button locations in arrays (or a two-dimensional array) and then pass these locations to a subroutine that checks whether the mouse event was within the array parameters passed to it. eV+Language User's Guide, v2.x, 18318-000 Rev A Page 171