Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

check timer against array values

$
0
0
Hi All,

I'm trying to get my head around a statement and was wondering if anyone could help me out?

I have a timer that counts up, this is set to use 3 variables, $min, $sec and $milsec. I also have an array that has a number of times ie;


[ autoit ]      
;count $array[0][0] = 3 ;Cue 1 $array[1][0] = 00 ;Min $array[1][1] = 00 ;Sec $array[1][2] = 5 ;Millisec ;Cue 2 $array[2][0] = 00 ;Min $array[2][1] = 02 ;Sec $array[2][2] = 3 ;Millisec Cue 3 $array[3][0] = 01 ;Min $array[3][1] = 03 ;Sec $array[3][2] = 9 ;Millisec

As a demo I have only 3 entries but i'm thinking of running up to 200-300 timers in the array. I'm trying to create a statement that will check if the timer is the same as a timer in the array and run a function. The only way i can think of doing this would be to create a while loop when the timer is counting to check if the time is the same but I don't want to overload the program. ie.

[ autoit ]      
$i = 1 While $i <= $linecount - 1 if $min == $array[$i][0] and $sec == $array[$i][1] $milsec == $array[$i][2] then dofunc($i) EndIf $i = $i + 1 WEnd

Is there a better way to do this on a big array?

Viewing all articles
Browse latest Browse all 12506

Trending Articles