DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Using 'AutoActPath' in a User Command?

Hello,
 
I have defined a User Command and I would like to include an initilization file that sets certain paths (outside of the User Command ideally).  The file I was planning on using was just another VBS with some global variables declared.  For example: 
 
---Initilization file begin---
GlobalDim("ParentDIAdemPath ")
ParentDIAdemPath = "c:\MyPath\"
---Initilization file begin---
 
And I would like to include this or start this script in my User Command script.  However, the 'AutoActPath' variable does not seem to be set by the time the User Command is running - is this correct?  For example, in my User Command, if I try:
 
Call ScriptInclude(AutoActPath & "InitilizationFile.VBS")
 
I receive an error, and the value of AutoActPath is "???"
 
Perhaps there is a better way to accomplish what I would like to do?  Thank you!
 
Julia
 
 
0 Kudos
Message 1 of 2
(4,053 Views)

Hi Julia,

Yes, that sounds familiar.  I believe that running a VBScript as a User Command is different from running it from the SCRIPT panel, and this difference renders AutoActPath unusable, sadly.

What I have done is to declare the User Command VBScript dynamically with a ScriptCmdAdd() call during DIAdem's startup cycle.  Within the VBScript which declares the User Command, AutoActPath still works, and this information can be assigned to a GlobalDim variable so that the UserCommand has access to it.  If you look at the ResultsList_Menus_Add example in DIAdem 10.x, this is exactly how that works.

Brad Turpin
DIAdem Product Support Engineer
National Instruments

0 Kudos
Message 2 of 2
(4,045 Views)