11-22-2011 02:15 PM
Hi all,
I'm using the ScriptInclude and ScriptStart commands to modularize my post processing code. All my scripts are saved in a workspace. Often, a script that was working will throw the error:
Error in <PDP - Top Level.VBS> (Line: 8, Column: 1):
The VBS script <Define Globals - PDP.VBS> does not exist!
despite the supposedly non-existent script not only being, in fact, a thing which exists but also a thing that is open and visible at the time the error occurs. There's a screenshot attached.
Anyone seen this issue? Any suggestions?
Thanks,
Scott
Solved! Go to Solution.
11-23-2011 04:55 PM
Hello testingHotAir,
I'm a bit baffled by the error as I'm sure you are as well. You may want to consider using ScriptInclude instead of StartScript in your code. Please review the following article which outlines when best to use each function. I would see if this causes the error to go away.
Command: ScriptStart
http://zone.ni.com/reference/en-XX/help/370859H-01/comoff/scriptstart/
Best of luck!
11-23-2011 10:12 PM
Hi Scott,
You should provide the full path to the VBScript file you want to call with ScriptInclude or ScriptStart-- you are taking pot luck by referencing the file name only. These functions have no knowledge of what scripts you have open in the SCRIPT panel editor, and in fact you can have multiple files with the same name open in the SCRIPT editor at the same time (which come from different folders). Try this, place all your script files in the same folder, then add the full path in programmatically with the AutoActPath global variable, which always contains the folder of the currently running top-level script file:
Call ScriptInclude(AutoActPath & "MyFileName.VBS")
Call ScriptStart(AutoActPath & "MyFileName.VBS")
Brad Turpin
DIAdem Product Support Engineer
National Instruments
11-28-2011 08:27 AM