From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

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
(2,865 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
(2,855 Views)