AutoHotKey: Accessing an array of coordinates -


in autohotkey, i've defined global array as:

tab_index_array := [] 

further down in script call function build table:

buildtabindexarray() {   global    ; coords of each of 8 selectable tabs on screen   tab_index_array.push(332,490)   tab_index_array.push(378,490)   tab_index_array.push(433,490)   tab_index_array.push(486,490)   tab_index_array.push(557,490)   tab_index_array.push(611,490)   tab_index_array.push(685,490)   tab_index_array.push(745,490) } 

this seems pretty straight forward me, however, when i'm trying access table, ever blank (empty) values.

clicktab(which_tab) {   global    coords_ := []   tab_str := tab_index_array[which_tab]    stringsplit, coords_, tab_str, ","    x_ := coords_[1]   y_ := coords_[2]    splashtexton,,, %x_% "`n" %y_%    settimer, killsplashtext, -5000    ;setmousedelay, slow_click_wait_time   ;sendevent {click, %x_%, %y_%}   ;setmousedelay, click_wait_time } 

what doing wrong? want grab coordinates out of array , feed them sendevent command. can give appreciated i've been fighting time now.

thanks,

since want store string in each of fields of tab_index_array, need put in quotes,

tab_index_array.push("332,490") 

function calls , definitions, includes if(), .push(), strlen() , on, work functions work in other programming languages, too. can leave aside quotes in autohotkey commands quite comfortable confusing sometimes.

further information can found @ http://ahkscript.org/docs/variables.htm


Comments

Popular posts from this blog

javascript - Slick Slider width recalculation -

jsf - PrimeFaces Datatable - What is f:facet actually doing? -

angular2 services - Angular 2 RC 4 Http post not firing -