OnInterface Event

The OnInterface() driver module event occurs whenever a driver interface event occurs. The supported events are one of ATEasy's supported driver interfaces' events defined in enumAInterfaceEvents. Thus, the code contained in the OnInterface event will execute whenever an interface event occurs. The enInterfaceType parameter for the OnInterface event specifies which interface, one of interface Only applicable events are called as the current driver shortcut is defined (on of enumAInterfaceType). Once the event is called, the enCause parameter specifies which specific event caused this OnInterface event. The OnInterface driver event is similar to the user defined events procedures that are called as result of calling SetInterfaceEvents procedure.

Example

In this procedure, the status bar pane text changes depending on whether data is being sent or received over the TCP/IP connection.

 

Procedure OnInterface(enInterfaceType, lAddress, enCause): Void Public Compile ! Occurs when a driver interface fires event

--------------------------------------------------------------------------------

enInterfaceType: Val Internal.enumAInterfaceType

lAddress: Val Long

enCause: Val Internal.enumAInterfaceEvents

s: String

{

if enInterfaceType<>aioWinSock then return

 

if enCause and aioWsRead

sbr1.Panes(1).BackColor=aclrDarkMagenta

sbr1.Panes(1).ForeColor=aclrYellow

sbr.panes(1).Text = "TCP/IP Receive"

Driver Receive (s)

print s

elseif enCause and aioWsWrite

sbr1.Panes(1).BackColor=aclrCyan

sbr1.Panes(1).ForeColor=aclrDarkGreen

sbr.panes(1).Text = "TCP/IP Send"

endif

}

 

TCP/IP Send

See Also

SetInterfaceEvent