I'm converting some Visual Basic GUI programs into VBScript command line tools to test the availability of remote application servers.
I'm having trouble getting VBScript to handle a function that includes 3 'pass by reference' arguments, which the function updates with return information.
The Visual Basic code looks like this:
=========================================================
Dim bankLogonObject As Object
Dim retVal As Integer
Dim accountList As String
Dim responseCode As String
Dim classOfService As String
Set bankLogonObject = CreateObject("BankLogon.Logon")
'
' These arguments come from GUI text fields
'
' jobId, serverNumber, origID, userId, bankId, userPassword
retVal = bankLogonObject.ValidateLogon(jobId, serverNumber, origID, userId, bankId, userPassword, classOfService, accountList, responseCode)
=========================================================
I've made a VBScript that looks like this:
=========================================================
Dim bankLogonObject
'
' These arguments come from the command line
'
' jobId, serverNumber, origID, userId, bankId, userPassword
Set bankLogonObject = CreateObject("BankLogon.Logon")
set retVal = bankLogonObject.ValidateLogon(jobId, serverNumber, origID, userId, bankId, userPassword, classOfService, accountList, responseCode)
WScript.StdOut.WriteLine "retVal=" & retVal
WScript.StdOut.WriteLine "responseCode=" & responseCode
=========================================================
However, when I run it (on Windows NT4), I get:
=========================================================
C:\> cscript appTest.vbs
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.
appTest.vbs(17, 1) Microsoft VBScript runtime error: Type mismatch: 'ValidateLogon'
=========================================================
I've tried all sorts of syntax combinations, but cannot get it to work - any ideas?
I'm having trouble getting VBScript to handle a function that includes 3 'pass by reference' arguments, which the function updates with return information.
The Visual Basic code looks like this:
=========================================================
Dim bankLogonObject As Object
Dim retVal As Integer
Dim accountList As String
Dim responseCode As String
Dim classOfService As String
Set bankLogonObject = CreateObject("BankLogon.Logon")
'
' These arguments come from GUI text fields
'
' jobId, serverNumber, origID, userId, bankId, userPassword
retVal = bankLogonObject.ValidateLogon(jobId, serverNumber, origID, userId, bankId, userPassword, classOfService, accountList, responseCode)
=========================================================
I've made a VBScript that looks like this:
=========================================================
Dim bankLogonObject
'
' These arguments come from the command line
'
' jobId, serverNumber, origID, userId, bankId, userPassword
Set bankLogonObject = CreateObject("BankLogon.Logon")
set retVal = bankLogonObject.ValidateLogon(jobId, serverNumber, origID, userId, bankId, userPassword, classOfService, accountList, responseCode)
WScript.StdOut.WriteLine "retVal=" & retVal
WScript.StdOut.WriteLine "responseCode=" & responseCode
=========================================================
However, when I run it (on Windows NT4), I get:
=========================================================
C:\> cscript appTest.vbs
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.
appTest.vbs(17, 1) Microsoft VBScript runtime error: Type mismatch: 'ValidateLogon'
=========================================================
I've tried all sorts of syntax combinations, but cannot get it to work - any ideas?