shacho
asked on
Calling An External VBScript Function/Routine With Return Parameters
I want to run a VBScript function from another VBScript with parameters. How is this done?
'C:\Script1.vbs
Dim MyVar
MyVar = Blah(1, 2, 3)
'C:\Scrip2.vbs
Function Blah(Num1, Num2, Num3)
Blah = Num1 + Num2 + Num3
End Function
Mike
'C:\Script1.vbs
Dim MyVar
MyVar = Blah(1, 2, 3)
'C:\Scrip2.vbs
Function Blah(Num1, Num2, Num3)
Blah = Num1 + Num2 + Num3
End Function
Mike
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Tompa's reference to the second script is this bit:
src="Functions.vbs"
The file is a WSF file, as opposed to a VBS file, so you can save it as WSF and try it.
You can also try my approach, let me know if it works out.
Regards,
Rob.
src="Functions.vbs"
The file is a WSF file, as opposed to a VBS file, so you can save it as WSF and try it.
You can also try my approach, let me know if it works out.
Regards,
Rob.
ASKER
Hmm. I suppose that would work. But is there really no way to call functions script to script (vbs only) with return values?
Hi,
Not that I know. WSF or like Rob suggested are 2 solutions.
Best Regards Tompa
Not that I know. WSF or like Rob suggested are 2 solutions.
Best Regards Tompa
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Rob - that's a pretty clever workaround. Thanks all for your comments.
Mike
Mike
Great, thanks for the grade,
Regards,
Rob.
Regards,
Rob.
ASKER
Tompa - I don't see how you are specifying the path to the second script.
Rob - Interesting approach.
Mike