home *** CD-ROM | disk | FTP | other *** search
- // LOOKUP.SCP Sample Script
- // Copyright (c) 1999, Vector Networks Limited
- // All Rights Reserved
- //
- // Revision History:
- // 5.0 09-Dec-99 DB - Created.
-
- // This is a simple script which performs a LookUp on
- // TCP/IP. For each Client that responds, it calls
- // ProcessClient which can be modified to do
- // whatever you want...
-
- Function Main ()
- Dim ClientsList, ClientNum, ClientTotal
- Dim CurClient, ClientName
-
- SetTransport (T_TCPIP)
-
- Print "Browsing the Network for Clients. Please wait..."
-
- LookUp ("", ClientsList)
- ClientTotal = Items (ClientsList)
- Print CStr (ClientTotal), " Clients found"
- ClientNum = 1
-
- // Now, work through the list of Clients
-
- For Each CurClient in ClientsList
- ClientName = GetClientName (CurClient)
-
- If ProcessClient (CurClient, ClientName) Then
- Print "Client ", ClientNum, " <", ClientName, "> processed successfully"
- Else
- Print "Client ", ClientNum, " <", ClientName, "> processing FAILED"
- EndIf
- ClientNum = ClientNum + 1
- Next
- End Function
-
- // ProcessClient is a generic Function which can be altered
- // to Do almost anything on a specific, named Client.
-
- Function ProcessClient (CurClient, ClientName)
- Print "Processing Client <", ClientName, ">"
-
- If Connect (CurClient) == TRUE Then
- Print "Connected to ", ClientName
- Disconnect (CurClient)
- ProcessClient = TRUE
- Else
- Print "Unable to connect to ", ClientName
- Print "Error ", LASTERROR, " = ", LASTERRORSTRING
- ProcessClient = FALSE
- EndIf
- End Function
-