Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
max 255 local variables
#2
Don't need to declare new variable for each window. Reuse existing variable. If it is the same window, then need just single win(...).

int w1=wait(1000 WV win("test" "WindowsForms10.Window.8.app.0.33c0d9d"))
...
wait 1000 S "C:\macro\immagini\test1.bmp" child("_ctl.Window" "test" w1) 0 1|4|16|0x400 40 ;; '_ctl.Window'
...
wait 1000 S "C:\macro\immagini\Username.bmp" child("_ctl.Window" "test" w1) 0 1|4|16|0x400 80 ;; '_ctl.Window'
...

If a macro needs more than 255 variables, it almost always means that the macro is incorrectly programmed. It should either reuse variables (like in this case), or replace similar code blocks with single loop (rep or for), or move parts of the macro to functions and call them, or use arrays or user-defined types. Then the macro also will be smaller, sometimes many times smaller.

When posting QM code, please copy the code in QM using menu Edit -> Other Formats. Don't use the Code button when pasting here.


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)