Technical support and scripting issues
Moderators: JRL, Dorian (MJT support)
-
Scones
- Junior Coder
- Posts: 32
- Joined: Fri Jul 05, 2019 11:21 am
Post
by Scones » Mon Oct 07, 2019 11:53 am
Hello.
I recently found out how much faster my scripts run without logging enabled, so i want to try and not use it.
My problem:
I have a script with a non modal dialog with a "Send bug report" button. The user presses the button, and the script copies the log file into my bugreport folder and stops the script.
I really need to know where the script froze every time this happens, so the most important thing is that i somehow log which line was executed last when that button is pressed.
Is there any way to do this?
Thanks in advance!

-
Dorian (MJT support)
- Automation Wizard
- Posts: 1417
- Joined: Sun Nov 03, 2002 3:19 am
Post
by Dorian (MJT support) » Mon Oct 07, 2019 12:42 pm
The System Variable _LINE_NUM returns the current line being executed and may be a good starting point for what you're trying to do.
See it in action :
-
JRL
- Automation Wizard
- Posts: 3531
- Joined: Mon Jan 10, 2005 6:22 pm
- Location: Iowa
Post
by JRL » Mon Oct 07, 2019 1:52 pm
Another possible method is the to use the "_WRITE_LOG_FILE" system variable. When it is set to "0" logging is suspended until you reset it back to "1". If the script always fails in the same place or places, those may be the only places that need to be logged.
Code: Select all
Let>_WRITE_LOG_FILE=0
//Lines of code not being logged so script runs fast.
.
.
.
//////
Let>_WRITE_LOG_FILE=1
//Lines of code to be logged:
.
.
.
//////
Let>_WRITE_LOG_FILE=0
//Again not logging...etc.
-
Dorian (MJT support)
- Automation Wizard
- Posts: 1417
- Joined: Sun Nov 03, 2002 3:19 am
Post
by Dorian (MJT support) » Tue Oct 08, 2019 10:19 am
JRL wrote: ↑Mon Oct 07, 2019 1:52 pm
Another possible method is the to use the "_WRITE_LOG_FILE" system variable. When it is set to "0" logging is suspended until you reset it back to "1". If the script always fails in the same place or places, those may be the only places that need to be logged.
Code: Select all
Let>_WRITE_LOG_FILE=0
//Lines of code not being logged so script runs fast.
.
.
.
//////
Let>_WRITE_LOG_FILE=1
//Lines of code to be logged:
.
.
.
//////
Let>_WRITE_LOG_FILE=0
//Again not logging...etc.
Nice!!

-
Scones
- Junior Coder
- Posts: 32
- Joined: Fri Jul 05, 2019 11:21 am
Post
by Scones » Thu Oct 10, 2019 12:11 pm
Thanks to you both! I have something to work with.