Example 2: Use Variables in Scripts

You can use and assign Variable IDs in CimEdit scripts.

The following example shows you how to use a Variable ID in a script.

Sub OnMouseUp(x As Long, y As Long, flags As Long)

   Dim var As CimObjectVariable

   Set var = CimGetScriptOwner().GetVariable("PointValue")

   i = PointGet(var.Value)

   PointSet var.Value, i+1

End Sub

The following example shows you how to assign a Variable ID in a script.

Sub OnMouseUp(x As Long, y As Long, flags As Long)

   Dim var As CimObjectVariable

   Set var = CimGetScriptOwner().GetVariable("PointValue")

   Var = "DEMO_SAWTOOTH"

   i = PointGet(var.Value)

   PointSet var.Value, i+1

End Sub

More information

Variables examples.