A sample basic control engine script illustrating these two functions and testing for their return values is provided below. In this example, a message is generated and cleared to a project called PROJ, with a marquee resident process called MQRP1 controlling a marquee device called DEV1.
Sub Main()
’
’ Sample program which demonstrates Marquee extensions to BCE.
’
Dim i As Integer
i = MarqueeMessageGenerate ("PROJ", "MQRP1", "DEV1", "MSG from BCE",
"MSG1")
CheckStatus i
i = MarqueeMessageClear ("PROJ", "MQRP1", "DEV1", "MSG1")
CheckStatus i
End Sub
Sub CheckStatus (i As Integer)
Select Case i
Case MARQ_SUCCESS
msgbox "Message was successfully generated/cleared."
Case MARQ_NOCOMM_PROJECT
msgbox "Problem communicating with the project you specified."
Case MARQ_BAD_DEVICE
msgbox "You have specified an invalid device."
Case MARQ_CANT_DELETE
msgbox "Cannot delete the message you specified."
Case MARQ_EMPTY_PROJECT_ID
msgbox "You have specified an empty Project ID."
Case MARQ_EMPTY_SERVICE_ID
msgbox "You have specified an empty Service ID."
Case MARQ_EMPTY_DEVICE_ID
msgbox "You have specified an empty Device ID."
Case MARQ_EMPTY_REF_ID
msgbox "You have specified an empty Reference ID."
Case MARQ_INVALID_SERVICE_ID
msgbox "The MQRP Service ID you specified was invalid."
Case Else
msgbox "Unexpected error:" & i
End Select
End Sub
Extensions to the Basic Control Engine. |