Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: passing parameters EXEs EXE's Calls dynamic parameters
There are (at least) five ways to pass information from a called WinBatch WBC back to the calling WinBatch EXE:
- Via an INI file (IniWrite[Pvt] / IniRead[Pvt])
- Via a text file (FileWrite / FileRead)
- Via a file name (FileCopy or FileRename / FileExist)
- Via the clipboard (ClipPut / ClipGet)
- Via a window (Display or Message / MsgTextGet)
Each method involves a write/read function pair (shown in parentheses): first the called EXE places the desired information in an accessible location using the "write" function, then the calling EXE retrieves the information using the "read" function.
Here is an example using the first (INI) method, since it's easy, clean, efficient, and safe:
; MAIN.WBT (which can be compiled to an EXE) number = AskLine("SquareIt", "Please enter a number:", "") If number == "" Then number = 0 RunWait("squareit.exe", number) result = IniRead("SquareIt", "Result", "") Message("SquareIt", "%number% squared is %result%") ; SQUAREIT.WBT (which should be compiled to SQUAREIT.EXE) square = param1 * param1 IniWrite("SquareIt", "Result", square)
Article ID: W12998
Filename: Passing Info from WinBatch EXEs to Calls.txt
File Created: 1999:04:15:16:51:04
Last Updated: 1999:04:15:16:51:04