get_last and multi-dimensional array
Kailex
Posts: 5
Can anyone tell me if get_last works with multi-dimensional arrays? If so what index does it return and should you use an array to store what is returned?
Thanks
Thanks
0
Comments
4 preset buttons and 3 switchers (audio, video, rgb)
DVD = in 1 audio, in 1 on video, not connected on rgb switch
VCR = in 2 audio, in 2 on video, not connected on rgb switch
PC = in 3 audio, in not connected on video, 5 on rgb switch
AUX = in 4 audio, not connected on video, 8 on rgb switch
I'd like to use a multi-dimensional array to setup the routes as follows:
Does get_last return first index (row) the second index (column) or both indexes (an array of values, row and column)?
In the above example if I press the DVD preset button (201) and use get_last(myrouting) what is returned.
1 or {1, 1}
Thanks for the assistance.
How is your BUTTON_EVENT defined? You can?t do something like:
BUTTON_EVENT[dvTP,myrouting]
Also GET_LAST() will only return one number, it will never return something like (1,1).
Here?s a quick example of how GET_LAST() works:
And here is the output when you push 201,202,203 and then 204:
Line 1 :: GET_LAST() index = 1 - 15:35:17
Line 2 :: GET_LAST() index = 2 - 15:35:20
Line 3 :: GET_LAST() index = 3 - 15:35:23
Line 4 :: GET_LAST() index = 4 - 15:35:26
HTH
Errr... why don't you just try it and find out?
However, I think I can use the index from get_last from a single dimensional array to get what I need from a separate multi-dimensional array that contains routing or whatever.
example:
I'm sure there's probably an easier way, but this has answered my question.
Thanks for the help.
Scroll up to post #6 by GSLogic. It?ll get you closer to where you want to go. You should be able to dump the SWITCH CASE stuff.
You are kind of defeating the purpose of GET_LAST.