[Implemented] END #ExitCode

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
GPI
PureBasic Expert
PureBasic Expert
Posts: 1394
Joined: Fri Apr 25, 2003 6:41 pm

[Implemented] END #ExitCode

Post 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...
Last edited by GPI on Wed Mar 24, 2004 9:34 pm, edited 1 time in total.
Pupil
Enthusiast
Enthusiast
Posts: 715
Joined: Fri Apr 25, 2003 3:56 pm

Post 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).
GPI
PureBasic Expert
PureBasic Expert
Posts: 1394
Joined: Fri Apr 25, 2003 6:41 pm

Post 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.
GPI
PureBasic Expert
PureBasic Expert
Posts: 1394
Joined: Fri Apr 25, 2003 6:41 pm

Post 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
Post Reply