Wilson WindowWare Tech Support

WinBatch WinBatch+Compiler WebBatch
Home | Tech Database | Tech BBS | White Papers | Purchase


Master and Child Scripts: Code to Display Command Line Parameters Passed to Winbatch

Keywords:   Master and Child Scripts

#DEFINEFUNCTION LaunchChild(parameters)
   moi=IntControl(1004,0,0,0,0)
   type=rtstatus()
   if type==0 ;interpreted
      parameters=strcat('"',moi,'" ',parameters)
      run("winbatch.exe",parameters)
   else       ; compiled
      Run(moi,parameters)
   endif
#ENDFUNCTION

if param0==0   ; normal entry
   BoxTitle("Master")
   ;run 5 children, with parameters.
   LaunchChild("aaa")
   LaunchChild("bbb")
   LaunchChild("ccc")
   LaunchChild("ddd")
   LaunchChild("eee")

   ;Give them all a few seconds to establish their titles
   TimeDelay(4)
   ;wait for them all to complete
   While WinExist("Child Worker")
      TimeDelay(1)
   endwhile

   ;report back that all is complete
   Message("Stop","All Children done")
   exit


else           ; child entry
   BoxTitle("Child Worker")
   Message("Child - My parameter is",param1)
endif
exit


Article ID:   W15346