How Do I Check Whether a Value Is Equal to NoValue in DIAdem Using VBScript?

Updated Jun 4, 2019

Issue Details

I would like to use the ChDX or ChD functions within DIAdem to check whether a number in my channel is equal to NoValue and my If .. Then statement is not executing.

How do I test whether a number from a channel is equal to NoValue using VBScript?

Solution

When using the ChDX and ChD functions, a NoValue is converted to a NULL in VBScript. Therefore you should use the IsNull function.

For example, assuming ChD(1,5) refers to a NoValue element in a channel:

If ChD(1,5) = NoValue
     [some code here]
End If


The above if statement will not execute.

If (IsNull(ChD(1,5)))
     [some code here]
End If


The above if statement will execute.