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

Called WBTs and WBCs

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

How to Retain your Command Line Parameters in Called WBC Files

Keywords:     callext

Question:

I was using the CallExt function so that the value of my called parameters is retained in my called subroutines, but I just found out that you can't compile the CallExt function into a Winbatch EXE.

Say I've got 3 parameters that I pass to Winbatch where param1=a, param2=b, and param3=c. And I use them in my main EXE. Then when I go to "Call" my WBC file, I pass param1=x, param2=y, and param3=z. Now, when I call my second WBC file, I pass on the command line param1=t, but I want want param2 and param3 to be empty. The problem is that param2 and param3 are still y and z respectively. How can I get around this without using CallExt, which retains their original values?

Answer:

Inside your main EXE, instead of "Call"ing WBCs, compile your two WBCs as small EXEs, and launch them with:
	runwait("myWB.exe", "x y z")

Article ID:   W13905
Filename:   How to Retain Parameter Values in Called WBCs.txt
File Created: 1999:04:15:16:57:10
Last Updated: 1999:04:15:16:57:10