12-07-2010 05:09 AM
Hi,
I know that i can display in a DIAdem report some pre-defined DIAdem vairiable (such as CurrDate) using @@Variable@@.
I would like to create a DIAdem user variable (from a DIAdem script) to be used in DIAdem report.
1) I have created a variable in my script
Dim myvariable
myvariable = "hello"
2) I have run the scirpt
3) I have put @@myvariable@@ in a Text
But a error message appears : Variable is undefined : 'myvariable'
How could a create a user varaible to be displayed in my report?
Thank
Solved! Go to Solution.
12-07-2010 05:21 AM
Hi malexman
You first have to register your script as a user command. Goto SCRIPT and select Settings»Options»Extensions»User Commands
More information can be found in the DIAdem help (e.g. Basics > General > Basic Information > Using User Commands)
Hope this helps
Winfried
12-07-2010 11:29 AM
Hi malexman,
The other option is to create a global variable from a normal (non-user-command) VBScript. There are several ways to do this, but the one we instruct new users to implement is the "GlobalDim" command, like this:
GlobalDim "UserVariable"
UserVariable = "hello"
You will notice that after this short VBScript runs the "UserVariable" changes color to show that it has become a global variable-- at that point you can use it in REPORT (and everywhere else in DIAdem, thus the name "global" variable).
Brad Turpin
DIAdem Product Support Engineer
National Instruments