Boolean State | Numeric Value in… | |
---|---|---|
Project Tag | VBScript Variable | |
FALSE | 0 | 0 |
TRUE | 1 | −1 |
This difference in how Booleans are handled can seriously affect runtime behavior if you use VBScript in your project. Logical and arithmetic operations — especially the NOT operator — could change tag values in unexpected ways.
You can change this behavior, if necessary, by changing your project's runtime settings.
[Script] VBBoolean=value
If VBBoolean is set to 0, then the project will behave as described above: all VBScript functions and operations will read/write a value of −1 for TRUE to Boolean tags. This is the default setting for projects created with InduSoft Web Studio v6.1+SP3 or earlier and then updated to v6.1+SP4, in order to maintain backward compatibility.
If VBBoolean is set to 1, then VBScript — as it is implemented within IWS — will read/write a value of 1 for TRUE to Boolean tags. (This does not affect Integer or Real tags.) This is the default setting for projects created with InduSoft Web Studio v6.1+SP4 or later.
'The following statements are valid If $MyBoolean = 1 Then End If If $MyBoolean = True Then End If If #Mne:@MyPointer = True Then End If 'The following statement is invalid If #Mne:@MyPointer = 1 Then End If