I' would like to replace the swpruncmd() by the command Run, but I've
some problems to reproduce the same behavior:
First swpruncmd() contains two last parameters : cRunPath, cTempPath.
Those parameters don't exist with Run. I've heard, I have to create a
wrapper to set / restore the DOS path
and TMP / TEMP environments inside my own function swpruncmd(). Does
anybody knows how to do this ?
Moreover swpruncmd() ruturn TRUE if the command interpreter was
executed, FALSE if an error occurred whereas run() return nil. How to
reproduce the same behavior (i.e how to know if the command has been
executed successfully or not)?
Regards,
mathmax
They do if you run a batch file, or (somehow) alter your environment.
> I've heard, I have to create a wrapper to set / restore
> the DOS path and TMP / TEMP environments
> inside my own function swpruncmd(). Does
> anybody knows how to do this ?
http://groups.google.com/group/comp.lang.xharbour/msg/e2312318e5f2e3f2
> Moreover swpruncmd() ruturn TRUE if the
> command interpreter was executed, FALSE
> if an error occurred whereas run() return nil.
> How to reproduce the same behavior (i.e
> how to know if the command has been
> executed successfully or not)?
Above, or
__Run( <cCmd> [, <@ErrLev>] )
... if you don't need a different environment / path.
David A. Smith
Thank you very much for that code. The implementation from Ron in very
nice (except a little mistake : IF DirChange( cPresetDisk ) != 0
should be replaced by IF DirChange( cPresetDir ) != 0 ).
Is there also some implementations for the functions SWPERRMAJ() and
SWPERRMIN() ?
Well, Ron's implementation returns the DOS error code... maybe you
could modify it to return an array of two elements should an error
occur...
David A. Smith