DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Define a global user constant in DIAdem 2017

Solved!
Go to solution

Hi all,

 

I would like to define a global user constant in a VBS script in DIAdem 2017, which is going to be used by other scripts. This constant will have information that depends on the computer I'm running the scripts. My idea is to only run once the script that defines the global user constant, and have the users run the other scripts without needing to worry about it.

 

I saw that there are "user variables" in DIAdem 2017 (link), but the recommended way of defining them (UserVarCompile) seems to be obsolete (link). Would anybody have an idea of how to implement this?

 

Thanks

Franco

0 Kudos
Message 1 of 5
(3,285 Views)

Hi Franco

 

There are several solutions for your problem. The easiest is that you use the global variables that are already defined in DIAdem: R1 to R32 for real variables, T1 to T10 for text variables, or O1 to O10 for variant variables.

A bit more complex is to define your global variables. In this help topic you find a description how to do this.

Defining User Commands and Global Variables

 

Hope this helps

Winfried

0 Kudos
Message 2 of 5
(3,271 Views)

Hi Winfried,

Thank you for your reply. I'm looking for something more "read only", i.e. once the variable has been defined it cannot be easily changed by another script. The "user variables" I mentioned earlier seems to have that option, is it possible to do that with a global variable defined through the user commands?

0 Kudos
Message 3 of 5
(3,265 Views)
Solution
Accepted by franco__

Hi Franco

Simply use the "const" in the user command script, eg:

const myTest = "this is myvalue"

This variable is readonly.

Message 4 of 5
(3,259 Views)

Hi Winfried,

I think this will work, thanks!

0 Kudos
Message 5 of 5
(3,231 Views)