Home AMX User Forum AMXForums Archive Threads AMX Applications and Solutions

Assigning Button Array Run time

I want to use Channel Array with TouchPanel to detect Button Event of all buttons mentioned in Channel Array.

If I initialize Channel Array with channel numbers then BUTTON_EVENT detected for all channel mentioned in the array. But if I assigned Channel Array with channel numbers run time then It doesnt get in to BUTTON_EVENT of assigned channels.

Can anyone tell me the reason of that ? Also suggest me any other way I can do what I am trying to do?

Thanks in Advance.

Comments

  • Joe HebertJoe Hebert Junior Member Posts: 2,159
    I want to use Channel Array with TouchPanel to detect Button Event of all buttons mentioned in Channel Array.

    If I initialize Channel Array with channel numbers then BUTTON_EVENT detected for all channel mentioned in the array. But if I assigned Channel Array with channel numbers run time then It doesnt get in to BUTTON_EVENT of assigned channels.

    Can anyone tell me the reason of that ? Also suggest me any other way I can do what I am trying to do?

    Thanks in Advance.
    The event table is built at compile time. If you want to dynamically assign channel arrays then you need to issue a REBUILD_EVENT() after the array is altered so that the event table gets rebuilt. Also depending on how you are assigning data to your array at runtime (it helps if you post sample code) you may need to do a SET_LENGTH_ARRAY() after you assign your data and before you issue REBUILD_EVENT()

    Try this thread for a further explanation:

    http://amxforums.com/showthread.php?t=4088&highlight=rebuild_event
Sign In or Register to comment.