DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Using VariantVarSet with OLE

Hi -

 

I am trying to play around with DIAdem OLE commands and I am using Visual Basic...

 

Here is my code segment...

    '
    Me.MousePointer = vbHourglass
    '
    ' Initialize TOCommand Interface:
    Set oDIAdem = CreateObject("diadem.tocommand")
    '
    strNew = txtVarValue.Text
    lSuccess = oDIAdem.VariantVarSet("BjmTestVar", strNew)
    '
    lSuccess = oDIAdem.VariantVarGet("BjmTestVar", strNew)
    txtRetValue.Text = strNew
    '
    Set oDIAdem = Nothing
    '
    Me.MousePointer = vbNormal
    '

The problem is that the variable gets cleared when I execute the VariantVarSet command.   I can have a value in the variable "BjmTestVar", and can get it with the VariantVarGet command, but when I use the set command the contents get cleared.   I can not get a value to be stored with the VariantVarSet...

 

Any pointers and/or suggestions?

 

Thanks for any assistance or information!

 

Bruce McPhee

EDS - An HP Company

0 Kudos
Message 1 of 2
(3,401 Views)

Hi Bruce,

 

I haven't used the VariantVarSet method myself, but in general in DIAdem you would need to create the global variant variable with the "GlobalDim" command before you could address it.  Alternatively, you could use one of the already pre-allocated variant temporary variables:

 

oDIAdem.VariantVarSet("O1", vVariant)

 

Brad Turpin
DIAdem Product Support Engineer
Mational Instruments

0 Kudos
Message 2 of 2
(3,385 Views)