I want to know if there's a way to call a function which sits in other VBS
file. This function suppose to return value.
I want the caller sub/method/function to get that value. the caller sub is a
VBS as well.
using executeglobal does call the function but it doesn't get the ret va.
Any one?
10x, Eran.
ExecuteGlobal sIncludeText
Result = TestIt(arguments)
will return the result you seek. The function can be called as many times
as you want with different argument, just as if it were part of the current
script's own text file. The main difference is that it is not easy to
troubleshoot any problems that might arise within the function. That's why
the generally prefered approach is to use the XML like WSF script approach
with a '<script src=filename.ext language=vbs>' tag to include the function
in your current job. See the 'XML Elements' entry in the WSH documentation
for more information on this approach.
Tom Lavedas
===========
10x for your help.
so basically, I should do the following:
Dim ofsFile,Ofs,Result
Set ofsFile = CreateObject("Scripting.FileSystemObject")
Set Ofs = ofsFile.OpenTextFile("c:\1.vbs")
Ofs.ReadAll
Ofs.Close
ExecuteGlobal Ofs
Result = RetVal() 'RetVal is a function in 1.vbs
"Tom Lavedas" <tlav...@hotmail.remove.com> wrote in message
news:26F7120A-C7EF-46C6...@microsoft.com...
Tom Lavedas
============