Link to home
Start Free TrialLog in
Avatar of shacho
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
SOLUTION
Avatar of Tompa99
Tompa99
Flag of Sweden image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Avatar of RobSampson
RobSampson
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of shacho
shacho

ASKER


Tompa - I don't see how you are specifying the path to the second script.
Rob - Interesting approach.

Mike
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.
Avatar of shacho

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
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of shacho

ASKER

Rob - that's a pretty clever workaround.  Thanks all for your comments.

Mike
Great, thanks for the grade,

Regards,

Rob.