Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Which is faster err or ifi: for Window/Control & Acc objects
#1
Hi Gintaras,
I was wondering, which is faster: err'ing out on a act win("name" "class") statement or running a ifi(win.... statement first and whether the same thing holds for acc statements. I couldnt find a ifi type equivalent for an acc element.
This makes a difference in rep loops and other type iterative tasks.
Thanks,
S
#2
Faster with if, because act waits a little for the window.

acc without waiting will be the same with err and with if.

acc with err:
Macro Macro1569
Code:
Copy      Help
;----
int w=win("QM TOOLBAR" "QM_toolbar")
Acc a=acc("x" "x" w "ToolbarWindow32" "" 0x1005)
err out "not found"

acc wit if:
Macro Macro83
Code:
Copy      Help
;----
int w=win("QM TOOLBAR" "QM_toolbar")
Acc a=acc("x" "x" w "ToolbarWindow32" "" 0x0005)
if(!a.a) out "not found"

To measure times, use perf() or Measuring speed with high precision


Forum Jump:


Users browsing this thread: 1 Guest(s)