11-09-2018 11:41 AM
Is there a way to access the line number of a script, while in that script? If I wanted to do some LogFileWrite commands and also record where in the script that was happening, is that possible?
Thanks!
11-12-2018 03:08 PM
Hi JuliaDawkins,
Are you referring to programatically determining the line number (such as "dim X = thisLineNum()" )? I don't believe VBScript has this functionality. If you're referring to just seeing line numbers in the script editor, you can right-click inside the editor and select "Properties", there is an option to enable/disable line numbers.
From what you've described, it seems like the closest thing would be to hard-code a line number into a LogFileWrite command.
11-19-2018 05:17 PM
I asked for this a long time ago, there was no way to do it back then. It's certainly there somewhere because the error message gives you the line number, but unless something changed since Diadem 2014, it's not available to the script interface.
My workaround for this was to make my log file calls as descriptive as possible, and then just copy from the log file and do a find in my script for that text.
11-19-2018 05:28 PM
Yes! "It's certainly there somewhere because the error message gives you the line number" 🙂 thanks for the input.
11-21-2018 03:18 PM
Hi Julia,
If I do not mind stopping the script, then can do a err.raise and it will always give me the line number.
If though I have the "on error resume next" turning of error reporting, then do not get any line number details.
Paul