Jump to content

Complex loops


ironmanexe
 Share

Recommended Posts

Lets say that your program was one gigantic complex loop. Now, the program is absicly done and you want to add a gui. But the gui requires its own loop. And the main loop only completes every so often. How can we make the gui refresh and also obtain values from the gui's controls.

I know someone will say to post the code but id rather not release this and also dont belive it's finished enough for you to see the full architecture.

_edit_

Would OnEvent Mode Suffice? How long does this pause the script, just long enopugh to complete its function?

Edited by ironmanexe

Time + Effort = Constant

Link to comment
Share on other sites

Lets say that your program was one gigantic complex loop. Now, the program is basically done and you want to add a gui. But the gui requires its own loop. And the main loop only completes every so often. How can we make the gui refresh and also obtain values from the gui's controls.

I'm just pulling this out of a hat, but you might try:

AdlibEnable("MajorLoopContents")
Func MajorLoopContents()
    AdlibDisable()
    ; Major loop code
    AdlibEnable("MajorLoopContents",1)
EndFunc

While GUIGetMsg() <> $MSG_EXIT
    ; your GUI
WEnd

I haven't tried this myself - it appears to be an abuse of the Adlib functions - but it's simple enough to be worth a try...

Link to comment
Share on other sites

Lets say that your program was one gigantic complex loop. Now, the program is absicly done and you want to add a gui. But the gui requires its own loop. And the main loop only completes every so often. How can we make the gui refresh and also obtain values from the gui's controls.

I know someone will say to post the code but id rather not release this and also dont belive it's finished enough for you to see the full architecture.

_edit_

Would OnEvent Mode Suffice? How long does this pause the script, just long enopugh to complete its function?

Try using AdlibEnable, that's what I do in my script, where I have a bunch of stuff that happens in a big loop basically, but I have some other code that I want to keep running over and over throughout the whole thing, AdlibEnable will do this. :P
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...