ToggleValue

<< Click to Display Table of Contents >>

 

ToggleValue

ToggleValue(TagName, ValA, ValB)

This method searches for an object value or property in execution on a server and compares it to ValA and ValB parameters. If the searched value is equal to ValB, the object or property specified in TagName receives the value of ValA. Otherwise, it receives the value of ValB. In case the value of TagName is not ValA nor ValB, this method sets the value specified in ValA. Example:

Sub Button1_Click()
  ' When clicking the button, sets the value
  ' to a Tag executed on a Data Server.
  ' Sets a value of 20 to the Tag.
  Application.SetValue "DataServer1.InternalTag1", 20
  ' As the value of InternalTag1 already is 20,
  ' the ToggleValue method alternates the value to 30.
  Application.ToggleValue "DataServer1.InternalTag1", 30, 20
End Sub

Was this page useful?