1. reading errorlevel value...

Hi all!

Is there anyone to know how to get the errorlevel value returned by
a program which is excuted by the "system()" command of Euphoria?

Thanks much in advance!

from Lee, woo seob.

new topic     » topic index » view message » categorize

2. Re: reading errorlevel value...

Lee woo seob wrote:
>Is there anyone to know how to get the errorlevel value returned by
>a program which is excuted by the "system()" command of Euphoria?

        Hey, for once I know an answer!  I remember this from reading the old
logs and here it is:
        Unless Robert Craig has changed something since then, the Watcom routine
Euphoria calls (when you call system() ) does not provide any meaningful
return value.
        Or, nope, can't do it.

Of course, somebody may have figured out how to get around that by now .
        . .


Craig

new topic     » goto parent     » topic index » view message » categorize

3. Re: reading errorlevel value...

Lee woo seob wrote:

> Is there anyone to know how to get the errorlevel value returned by
> a program which is excuted by the "system()" command of Euphoria?

MS-DOS has a couple of variables that any program can access call
environment variables

You can access them (from library.doc) like this:

------------------------------------<getenv>----------------------------------

 Syntax:      x = getenv(s)

 Description: Return the value of a DOS environment variable. If the
variable
                is undefined return -1.

 Example:     e = getenv("EUDIR")
              -- e will be "C:\EUPHORIA" -- or perhaps D:, E: etc.

 Comments:    Because either a sequence or an atom (-1) might be
returned, you
               should probably assign the result to a variable declared
as
               object.

 See Also:    command_line

------------------------------------<end of
getenv>---------------------------

The variable you want to call is 'ERRORLEVEL'
So to acces the errorlevel returned by an application do something like:

e = getenv("ERRORLEVEL")

And e will hold the ascII representation of the errorlevel value. (I
think)

I'm am not 100% sure about this, but in a batch file (.bat) you use the
same method to acces the errorlevel as you use with any other
environment variable.

Ralf Nieuwenhuijsen
nieuwen at xs4all.nl

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu