Jump to content

Question about GUIs, Performance, Callbacks and 2D Arrays


Recommended Posts

Hi All,

Noob Question #1: I am trying to write a high performance (lots of iterations in a short amount of time). I am currently extracting values (checkbox and textbox) from the GUI elements on each iteration of the loop. However, I suspect that this is inefficient and I might be better off calling an init() function to extract the GUI settings and store them in global variables. Will this make me run faster?

Noob Question #2: I am using Koda to design my GUI interface and observed that it declares variables for each GUI element. Do these variables update automagically each time the value changes - or are they simply declarations?

Expert Question #3: Does AutoIt support Timers with Callbacks. What I mean is, can I set a Timer to count backwards to zero and then have it trigger a callback function. I cannot find any information through search and I RTFM.

Expert Question #4: Does AutoIT support 2D arrays like histogram[10][30] and array indexing. I cannot find any information through search and I RTFM.

Thanks VERY much for all the support u guys provide!!! This is a great community.

Link to comment
Share on other sites

Noob Question #1: I am trying to write a high performance (lots of iterations in a short amount of time). I am currently extracting values (checkbox and textbox) from the GUI elements on each iteration of the loop. However, I suspect that this is inefficient and I might be better off calling an init() function to extract the GUI settings and store them in global variables. Will this make me run faster?

AutoIt in essence is a bad language to do anything in when you need high performance. I have no idea wether or not the Init function will make it faster, but I think that it probably will, else it wouldn't be there.. right? ;)

Noob Question #2: I am using Koda to design my GUI interface and observed that it declares variables for each GUI element. Do these variables update automagically each time the value changes - or are they simply declarations?

They are declarations. In any normal script the control ID as returned by the GUICtrlCreate functions are not changed, so there's no need to change them 'automagically'.

Edit: You can read the value from the checkbox or combobox with a GUICtrlRead command.

Expert Question #3: Does AutoIt support Timers with Callbacks. What I mean is, can I set a Timer to count backwards to zero and then have it trigger a callback function. I cannot find any information through search and I RTFM.

Not inherently, but you can make one yourself using more simpler commands easily.

Expert Question #4: Does AutoIT support 2D arrays like histogram[10][30] and array indexing. I cannot find any information through search and I RTFM.

Sure, just do something like this:

Dim $Cookie[5][10]

For $x = 0 to Ubound($Cookie,1)-1
    For $y = 0 to Ubound($Cookie,2)-1
         $Cookie[$x][$y] = "The value of $Cookie[" & $x & "][" & $y & "] is this string"
    Next
Next

Thanks VERY much for all the support u guys provide!!! This is a great community.

I know.. *sigh* :lmao: Edited by Manadar
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...