DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Using OdsValAlloc for Booleans

I can't seem to get the OdsVallAlloc command to work for booleans that are used in SUD dialogs.  See attached example.  Please advise....
0 Kudos
Message 1 of 2
(3,140 Views)

Hello Sarm!

A as 'ODS_TYPE_BOOL' allocated variable is internal a long integer. Therefore it will be defined as Longinteger in SUD. Second: 'ODS_TYPE_BOOL' variables can not be set with the VBScript 'true' you have to use 1 instead. You have two 'bln_Test' variables in your script. Delete the 'Dim blnTest_'. VBScript variables will win in the script! In the SUD dialog the DIAdem variable with the same name is used.

This changes result in this modified script:

Option Explicit

Call OdsValAlloc("blnTest_","ODS_TYPE_BOOL")

blnTest_ = 1

MsgBox "blnTest_ = " & (blnTest_ <> 0)

Call SudDlgShow("Dlg1", "blnTest.sud")

MsgBox "blnTest_ = " & (blnTest_ <> 0)

Call OdsValFree("blnTest_")

Matthias

Matthias Alleweldt
Project Engineer / Projektingenieur
Twigeater?  
0 Kudos
Message 2 of 2
(3,130 Views)