Jump to content

Resetting program flow? possible?


Recommended Posts

Hello, is there a way I can reset my programs flow to the start?

Im having a problem with this reset button I'ive added.

The function gets called but I always end up back in the function i was in before. Any way I can break this flow?

Thanks

MajSlayer420

Link to comment
Share on other sites

  • Moderators

Hello, is there a way I can reset my programs flow to the start?

Im having a problem with this reset button I'ive added.

The function gets called but I always end up back in the function i was in before. Any way I can break this flow?

Thanks

MajSlayer420

Change line 24 and you'll be fine.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

  • Moderators

Gee that helps allot:) lol So there is no way to reset my program without closing it and starting it again?

MajSlayer420

That was more information than what you provided buddy :whistle: .... Of course there is a way, if you structure properly.

Just make every single thing a function.... and when your ready to restart... call the _MainFunc().

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

  • Moderators

Yeah see I did just that. I call main but the the script stops, The buttons quit working:(

MajSlayer420

Fix line 24

Turtles

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

  • Moderators

Please smoke on I dont need your smart ass answers, keep'em to yourself pops

MS420

You're a dumb ass MajSlayer420... You ask for help with YOUR script, saying your GUI has issues when you try to restart your function... do you think we are mind readers idiot!? Post the f**king source that you are having issues with idiot.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Well if anyone with any sense could tell if me there is a command to restart your script, I'd like to know.

MS420

The truth is that SmokeN has far more sense than you do. If you stick around long enough, you will find that he is one of the most knowledgeable posters on this forum. We cannot tell you how to fix your code unless we see it, as SmokeN pointed out.

And a clearer description would be helpful as well. You want to start the script again from line one? If its a compiled script, just run it again.

Func _Restart()
run(@ScriptFullPath)
exit
endfunc

If you want to be sure that your GUI is deleted first, (to be sure you don't have two of them for a split second... not likely, but it could happen I suppose) simply include the code to delete your GUI in the restart function, or put a delay at the beginning of your script.

If your script is not compiled, consider using shellexecute() instead of run()

EDIT: while this solution may work, a more elegant way would involve re-structuring your code so that running it again isn't necessary. But we can't even begin to help you there without your code

Edited by improbability_paradox
Link to comment
Share on other sites

  • Moderators

"Hello, is there a way I can reset my programs flow to the start? "

Can I be any clearer???

Anyhow Thanks

MS420

Could you be any more dense?

Just make every single thing a function.... and when your ready to restart... call the _MainFunc().

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

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...