home *** CD-ROM | disk | FTP | other *** search
- // STEST.SCP - Sample Script for Siemens
- // Copyright (c) 1999, Vector Networks Limited
- // All Rights Reserved
- //
- // Revision History:
- // 0.0 12-Oct-99 DB - Created.
- // 5.3 31-May-00 DB - Separate log file code to ADDTOLOG.SCP.
- // - Use SetWindowMode (2) instead of FALSE.
- // 5.31 09-Jun-00 DB - Improve resistance to undefined variables
-
- $INCLUDE "ADDTOLOG.SCP"
-
- // Script requirements:-
- // Predefined variables:
- // Client = "VECNET"
- // User = "DB"
- // Username = "SCRIPTING/GBBLLYDGKK"
- //
- // The Script attempts to connect to the Client named in variable Client, using
- // the username (and password) contained in variable Username.
-
- Function Main ()
- Dim Client as String, User as String, Username as String
- Dim Filename as String, InstallDir as String
- Dim Handle, Status
-
- SetTransport (T_TCPIP)
-
- // Make sure we have something in User
-
- If Trim (User) = "" then
- User = "UNKNOWN"
- Endif
-
- If Connect (Client, Username) = TRUE Then
- Print "Logging User Access"
- InstallDir = GetInstallDir ("")
- FileName = ">" + InstallDir + "\" + User + ".LOG"
-
- AddToLog (FileName, User + " connected")
-
- Print "Opening View"
- Control ()
- SetWindowMode (2)
- WaitEndView ()
-
- AddToLog (FileName, User + " disconnected")
-
- Print "Disconnecting..."
- Wait (2)
- Disconnect (Client)
- EndIf
- End Function
-
-