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!
Logging scripts makes it slow. Need an alternative
Moderators: Dorian (MJT support), JRL
- Dorian (MJT support)
- Automation Wizard
- Posts: 1354
- Joined: Sun Nov 03, 2002 3:19 am
- Contact:
Re: Logging scripts makes it slow. Need an alternative
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 :
See it in action :
Code: Select all
MessageModal>%_LINE_NUM%
Yes, we have a Custom Scripting Service. Message me or go here
Re: Logging scripts makes it slow. Need an alternative
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: 1354
- Joined: Sun Nov 03, 2002 3:19 am
- Contact:
Re: Logging scripts makes it slow. Need an alternative
Nice!!JRL wrote: ↑Mon Oct 07, 2019 1:52 pmAnother 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.
Yes, we have a Custom Scripting Service. Message me or go here
Re: Logging scripts makes it slow. Need an alternative
Thanks to you both! I have something to work with.