SetConnectionByHandle

The SetConnectionByHandle method uses the connection handle to set the connection for a newly created autECLOIA object. In Z and I Emulator for Windows this connection handle is a Long integer. There can be only one Z and I Emulator for Windows connection open with a given handle. For example, there can be only one connection “A” open at a time.
Note: Do not call this if using the autECLOIA object in autECLSession.
DIM  autECLOIA as Object
DIM  autECLConnList as Object
 
Set autECLOIA = CreateObject("ZIEWin.autECLOIA")
Set autECLConnList = CreateObject("ZIEWin.autECLConnList")
 
' Initialize the connection
autECLConnList.Refresh
autECLOIA.SetConnectionByHandle(autECLConnList(1).Handle)
' For example, see if its num lock is on
If ( autECLOIA.NumLock = True ) Then
  'your logic here...
Endif