WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Functions

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Call vs CallExt Functions

Keywords: callext   

Question:

One of the documented restrictions for using compiled Winbatch scripts is that the CallExt function is not supported. How does the CallExt function differ from WILs Call function? If I can use Call do I really lose any functionality by avoiding CallExt?

I don't understand why CallExt is documented in the WINBATCH.HLP file, and why it's not in the WIL.HLP file, yet is referred to in the IntControl(1004,...) function.

I want to get the name of the called WBT, not the parent WBT. So CAN I use CallExt and then get the name with the IntControl(1004,...), and why isn't CallExt in WIL.HLP rather than WINBATCH.HLP, and why is it only semi-undocumented?

Answer:

CallExt is a WinBatch function (like the box functions) and not a WIL function. It's actually slated to be completely undocumented eventually and someday dropped. We don't like it. The CallExt is not really a call. It is the same as a:
        RunWait("winbatch.exe","yourscript.wbt")
The CallExt also will not compile. It cannot be used in compiled scripts.

The Call function simply incorporates the call'ed script into the current script. All variables are shared in common between the two scripts. It is just a subroutine call.

CallExt starts up a whole new copy of Winbatch to run the other script. There are no shared variables.

We recommend not using CallExt, and using the runwait method (above) if you must.

  1. If the current WinBatch script is a child program that was called with the CallExt( ) function, the IntControl(1004,...) will return the name of the current (called) program.

  2. If the current WinBatch script is a child program that was called with the Call( ) function, this IntControl will return the name of the main (calling) program.

We don't know of any sure-fire way to get the name of the called script in a compiled called WBT, however another way to get the name of the Winbatch.exe (or wbat16i.exe) is:

	RunWait(WinExeName(""), "xxx.wbt")

Article ID:   W13045
Filename:   Call vs CallExt.txt
File Created: 1999:04:15:16:51:22
Last Updated: 1999:04:15:16:51:22