Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

swpruncmd() & Run

32 views
Skip to first unread message

maximean...@gmail.com

unread,
May 27, 2008, 10:34:47 AM5/27/08
to
Hello,

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

dlzc

unread,
May 27, 2008, 12:46:31 PM5/27/08
to
On May 27, 7:34 am, maximeandrighe...@gmail.com wrote:
...

> 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.

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

maximean...@gmail.com

unread,
May 27, 2008, 4:27:15 PM5/27/08
to

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() ?

dlzc

unread,
May 27, 2008, 5:37:26 PM5/27/08
to
On May 27, 1:27 pm, maximeandrighe...@gmail.com wrote:

> On May 27, 6:46 pm,dlzc<dl...@cox.net> wrote:
>
>
>
>
>
> > On May 27, 7:34 am, maximeandrighe...@gmail.com wrote:
> > ...
>
> > > 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.
>
> > 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.
>
> 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

0 new messages