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.

Creating library files to be called by WB.exe

Keywords:   Call WBC WBT

Question:

I am trying to create a file to be compiled as WBC and will have subroutines that are used by several different programs. Some of the functions are to test if the current user is in the administrator group on nt machine. Another is to read a configuration file. I want all of these functions in one WBC. Is there any documentation with examples of the WBC source,ie.
:SubName
...
...
Return
and the large exe doing the calling, ie.
call("SubName","parm1")
or
gosub SubName
I've been trying to use the #include with not alot of luck. Debugging via Studio is important, and based on Marty's comments on the bugs there, I'm inclined to go with the WBC method.

Answer:

Make the first parameter of the CALL a subroutine label, E.g.

Main program---------------

CALL("XXX.WBC","ADD 111 222")
Message("",Answer)
CALL ("XXX.WBC","SUB 333 55)
Message("",Answer)
exit
XXX.WBT---------------------------
goto %param1%

:ADD
answer=param2+param3
return

:SUB
answer=param2-param3
return

Article ID:   W14350
Filename:   Creating library files to be called by EXE.txt
File Created: 2000:01:19:12:33:58
Last Updated: 2000:01:19:12:33:58