Page 1 of 1

[Implemented] END #ExitCode

Posted: Wed Mar 24, 2004 9:28 pm
by GPI
It would be nice, when a application can set a exitcode. For example with a additional parameter for the END-Command.

edit:

and a

ExitCode=RunProgramEX(RunProgram(DateiName$, [, Parameter$, ArbeitsVerzeichnis$ [, Flags]])

and for flag only the hide flag (btw, why no #pb_RunProgram_Hidden and #pb_RunProgram_wait exist?).
RunProgramEx should always wait for the end of the program.

I don't know exact, but lcclnk.exe seems to return a exitcode...

Posted: Wed Mar 24, 2004 9:32 pm
by Pupil
PB Manual wrote: End [ExitCode]
Ends the program execution correctly. The 'ExitCode' optional parameter can be specified if the program need to returns an error code (widely used in console programs).

Posted: Wed Mar 24, 2004 9:37 pm
by GPI
Pupil wrote:
PB Manual wrote: End [ExitCode]
Ends the program execution correctly. The 'ExitCode' optional parameter can be specified if the program need to returns an error code (widely used in console programs).
Ok, i really should RTFM...

but a runprogramex would be nice.

Posted: Wed Mar 24, 2004 9:54 pm
by GPI

Code: Select all

Procedure RunProgramEx(Exe.s,CMD.s,WorkDir.s,Flag)
  If Flag
    id=RunProgram(Exe,CMD,WorkDir,3)
  Else
    id=RunProgram(Exe,CMD,WorkDir,1)
  EndIf
  GetExitCodeProcess_(id,@exitcode)
  ProcedureReturn exitcode
EndProcedure