The steps that follow describe how to change the data source of a FIX event in the run-time environment.
To change the data source of a FIX
event in the run-time environment:
- In Database Manager, create an AI block and a DO block.
- Create a new Picture.
- Insert a FIX event.
- Name the FIX event, and choose the AI block as a data source.
- Add a rectangle to your picture. Right-click the rectangle and select Edit Script from the pop-up menu.
- Enter the following code in the rectangle's Click event:
Dim obj As Object
Dim Count As Integer
'Set obj equal to the collection of objects contained in 'the active picture
Set obj = Application.ActiveDocument.Page.ContainedObjects
Count = obj.Count
'Loop through all of the objects in the picture to find 'any that are Event objects.
While Count > 0
'If the object is an Event object, change its source
If obj.Item(Count).ClassName = "FixEvent" Then
obj.Item(Count).Source = "Fix32.ThisNode.DO.F_CV"
'Display a message box that describes the change.
MsgBox "The Fix Event " & obj.Item(Count).Name & _
" is now connected to the data source " & _
obj.Item(Count).Source
End If
Count = Count – 1
Wend
- Switch to the run-time environment and click the rectangle. The message box appears stating that the source has changed.
See Also
Creating a Direct Connection to an Object
Changing a Text Object's Caption
Changing a Variable Object's Current Value