oShell = Createobject('WScript.Shell') oShell.Exec(lc + ' "'+lcParameter+'"')if not then I would recommend the API_RUN class as developed by the late Ed Rauh. You can find this class in the Downloads as file#9477. To implement this class in your code would take the following code:
local lo, lcCmdline IF NOT '\process' $ LOWER(SET('classlib')) SET CLASSLIB TO 'process' additive ENDIF * - Passing string parameters lcCmdLine = lC + ' "'+ lcParameter + '"' lo=CREATEOBJECT('api_apprun',lcCmdLine,FULLPATH('.')) lo.launchapp() lo = ''This is a typical implementation of the run command, but I would develop my own procedure for generic running of programs.
Procedure RunCmd lPar pCmd,p1,p2,p3,p4,p5,p6,p7 local lcCmd, i lcCmd = '' if pcount() > 0 set textmerge on to memvar lcCmd noshow \<<lcCmd>> for i = 1 to pCount()-1 lcPar = 'p'+trans(i) lcPar = eval(lcPar) ** Can only pass by value do case case vartype(lcPar) = 'C' \\ "<<lcPar>>", case inlist(vartype(lcPar), 'D','T' \\ {<<lcPar>>}, case inlist(vartype(lcPar),'L','N' \\ <<lcPar>>, endcase endfor set textmerge to *** Remove extra comma if i > 1 lcCmd = left(lcCmd,len(lcCmd) - 1) endif local lo IF NOT '\process' $ LOWER(SET('classlib')) SET CLASSLIB TO 'process' additive ENDIF lo=CREATEOBJECT('api_apprun',lcCmd,FULLPATH('.')) lo.launchapp() lo = '' endifBill I did not test this code, but I am sure you can go from here if you choose.
>Finally got a simple one to run by doing: >lc = getfile() >run ["&lc"] >>Now I need to include a parameter in lc:
>lc = getfile() >------ option 1 ------- >lc = lc + [ "] + lcParameter + ["] >run ["&lc"] && doesn't work because there are ["]s in lc >run ['&lc'] && doesn't work either > >------ option 2 ------- >lc = lc + [ '] + lcParameter + ['] >run ["&lc"] && doesn't work either > >Any idea how I can accomplish this? >>
>>run ["c:\Set Time\settime.bat"] >>>>