Jump to content

Need to start the tool from last termination point


Recommended Posts

There's not enough information here to help you. What tool are you talking about? Is this like CNC milling?

 also if you can post your script using the code tags <> Then we might be able to help you even more. thank you

Edited by Earthshine

My resources are limited. You must ask the right questions

 

Link to comment
Share on other sites

Thank you @Earthshine

I want a logic for, if a auto it program working fine. But sometimes for any reason the program is terminated at any point of the program. So some work is already complete by this program. So I want if  unexpected termination happens on my program, at the next time when I will run or it will run automatically, it should start from the last termination point. It will not going to start from initial. 

Link to comment
Share on other sites

Just now, Ade1234 said:

Thank you @Earthshine

I want a logic for, if a auto it program working fine. But sometimes for any reason the program is terminated at any point of the program. So some work is already complete by this program. So I want if  unexpected termination happens on my program, at the next time when I will run or it will run automatically, it should start from the last termination point. It will not going to start from initial. 

My code is working fine but I want to avoid rework of my program after a unexpected termination. 

Link to comment
Share on other sites

Rather than adding a dirty hack to bad code, fix your program ny testing for possible runtime errors and handle them gracefully.

This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Link to comment
Share on other sites

10 minutes ago, jchd said:

Rather than adding a dirty hack to bad code, fix your program ny testing for possible runtime errors and handle them gracefully.

For a flow of keyboard manipulation any time user may distrub your code unintentionally, so I want to give to user a perfect code that whatever that interrupt, it will work smoothly. For your kind information I don't have any runtime errors on my code if it is there it is simple task to avoid. I will not come to forum for simple help to waste your precious time. 

Link to comment
Share on other sites

still no useful information here. I think you should search Google on error handling in autoit. There is no one error handler to rule them all and you can't possibly avoid every situation so you handle the ones that your program encounters

Edited by Earthshine

My resources are limited. You must ask the right questions

 

Link to comment
Share on other sites

And to say your program doesn't have any errors, well let me tell you everything has bugs and you darn well should be handling errors within your code.  If it didn't have errors then why did you say it would crash for any unknown reason?

asking folks to help and not showing your code won't get you far either. pro tip

as far as picking up where left off only you can design so that is possible. If you haven't then your dreaded major rework would have to happen

Edited by Earthshine

My resources are limited. You must ask the right questions

 

Link to comment
Share on other sites

  • Moderators
4 hours ago, Ade1234 said:

so I want to give to user a perfect code that whatever that interrupt, it will work smoothly.

You have seen the code and are not sure how to make it "perfect", and yet you're asking us to help you, but have ignored two requests to post your code. How are we supposed to assist when you have us guessing at what your code is doing? Please post what you have; help us help you.

Edit: Also moved thread to the correct forum.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

Agree with others to correctly handle possible errors.

But if you still want your desired way then here is possible way: pseudocode

Global $done
$done = IniRead('your.ini','Stage','Done')

If $done < 1 Then 
    ; ... code part 1
    WriteStage(1)
EndIf

If $done < 2 Then 
    ; ... code part 2
    WriteStage(2)
EndIf

; ...

; finish
WriteStage(0)
Exit

Func WriteStage($stage)
    $done = $stage
    IniWrite('your.ini','Stage','Done',$stage)
EndFunc

 

Edited by Zedna
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...