R.Wieser
2014-02-10 16:58:45 UTC
Hello All,
I've been loading two script files into a VBScript engine that I've embedded
into a program of mine, and now have a problem with the error callback. Or,
to be more specific, the line # mentioned as provided by the error callback.
The problem is that the two scripts -- the first is a somewhat fixed
"header" file (containing a number of constant definitions) and the second a
user-provided one, the actual script -- seem to be regarded as a single, big
script, causing an error-callbacks line # into the second, users script to
be offset by the ammount of lines in the first, header file. And will
ofcourse confuse the user (which needs to have no knowledge about or be
bothered by the header file). :-\
My question: Is there a way to compartimentalize those two scripts in the
scripting engine in such a way that the error-callback will be able to
display the correct line # of the error in either scriptblock, presumably
together with some kind of indication of in which scriptblock it happened.
Preferrably the solution would be generic (work for any number of loaded
files).
Regards,
Rudy Wieser
I've been loading two script files into a VBScript engine that I've embedded
into a program of mine, and now have a problem with the error callback. Or,
to be more specific, the line # mentioned as provided by the error callback.
The problem is that the two scripts -- the first is a somewhat fixed
"header" file (containing a number of constant definitions) and the second a
user-provided one, the actual script -- seem to be regarded as a single, big
script, causing an error-callbacks line # into the second, users script to
be offset by the ammount of lines in the first, header file. And will
ofcourse confuse the user (which needs to have no knowledge about or be
bothered by the header file). :-\
My question: Is there a way to compartimentalize those two scripts in the
scripting engine in such a way that the error-callback will be able to
display the correct line # of the error in either scriptblock, presumably
together with some kind of indication of in which scriptblock it happened.
Preferrably the solution would be generic (work for any number of loaded
files).
Regards,
Rudy Wieser