-
Background.
I am writing some VBA for iGrafx which iterates a directory hierarchy, opens diagrams, does something with them, then closes them. This process can take several hours to run. The VBA is flakey and crashes out frequently.
EDIT: Not my code thats flakey, but the Object Model exposed by the Application.
Question.
What is best way to log current position so I can restart where I left off, rather than having to start at the beginning?
I currently write my position to a log file, then check for its existence. If the file exists I read the number from it and know where to re-start. Is this the way to go, or is there something better?
-
A log seems to be the easiest way. Alternatively, you could maintain the history of crashes in a database for later analysis or auditing. Or if it's just a few values and you want to hide this, you could write to the registry.
-
Cheers, never thought about writing to the registry. Is this faster than opening-writing-closing a .txt file?
-
I don't think any performance difference would be significant. Each individual value would just be committed sooner and hidden/protected from the user.