Using The _LINE_NUM Variable To .txt file
Moderators: JRL, Dorian (MJT support)
-
- Pro Scripter
- Posts: 70
- Joined: Wed Nov 08, 2017 6:54 pm
Using The _LINE_NUM Variable To .txt file
Is it possible to log the variable _LINE_NUM to a text file on the event that the _LINE_NUM variable has not changed in a certain period of time? Any tips or suggestions are welcome as this would greatly help me debug errors when the script runs into a dead end point without using the debugger. I would like to log the script line that the script has run into a dead end at into a .txt file so that I can better locate the dead ends in my script.
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Re: Using The _LINE_NUM Variable To .txt file
No but you can dump all variables to the log file with _DUMP_VARS and then analyse the log file. But ... not sure this makes sense ... if line number stops changing then nothing else could possibly be happening either, so your issue will always be right at the end of the log file showing the last thing that happened. So really all you need to do is look at the end of the log file.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
-
- Pro Scripter
- Posts: 70
- Joined: Wed Nov 08, 2017 6:54 pm
Re: Using The _LINE_NUM Variable To .txt file
Will the log still get logged with a compiled exe?
-
- Pro Scripter
- Posts: 70
- Joined: Wed Nov 08, 2017 6:54 pm
Re: Using The _LINE_NUM Variable To .txt file
Basically when a non modal dialog is open for too long with no user interaction or input I want to log the wait as an error into the top line of a txt file but only after a lengthy period of time has passed. How would this be achieved?
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Re: Using The _LINE_NUM Variable To .txt file
Not sure how you could. If it's modal the script can't do anything while it's open. But if you create a second macro and compile it to an .exe that could WaitWindowOpen the dialog and then loop until it's closed, measuring elapsed time as it goes. Stop looping when elapsed time reaches your desired timeout, and record to log file, or stop looping and start again if closed.
OR, don't use a modal dialog, use a non-modal dialog and have your macro loop once it's opened, waiting for it to either be closed or the timeout expires. Effectively this replicates how a modal dialog works - a loop holds things up until it's closed, but with the addition of a timeout check within the loop.
OR, don't use a modal dialog, use a non-modal dialog and have your macro loop once it's opened, waiting for it to either be closed or the timeout expires. Effectively this replicates how a modal dialog works - a loop holds things up until it's closed, but with the addition of a timeout check within the loop.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
-
- Pro Scripter
- Posts: 70
- Joined: Wed Nov 08, 2017 6:54 pm
Re: Using The _LINE_NUM Variable To .txt file
This is a great idea, thanks I will check it out. Compiling another exe may be a viable option at this point. Thanks Marcus 
