Jump to content

exitcodes


Recommended Posts

i've got 7 screens with back and next buttons on them, back exits with code 1 next exits with code 2

then i create this setup.au3 file to load the screens and allow back and forward

only problem is i cant read the exit codes, i get unknown macro @exitcode when i run this

Runwait ("screen1.exe")

Runwait ("screen2.exe")

if @exitcode = 0 Then exit

if @exitcode = 1 Then Runwait ("screen1.exe")

if @exitcode = 2 Then Runwait ("screen3.exe")

Link to comment
Share on other sites

i've got 7 screens with back and next buttons on them, back exits with code 1 next exits with code 2

then i create this setup.au3 file to load the screens and allow back and forward

only problem is i cant read the exit codes, i get unknown macro @exitcode when i run this

Runwait ("screen1.exe")

Runwait ("screen2.exe")

if @exitcode = 0 Then exit

if @exitcode = 1 Then Runwait ("screen1.exe")

if @exitcode = 2 Then Runwait ("screen3.exe")

i could just use this i suppose

@echo off

:one

start /wait screen1.exe

if errorlevel 3 goto end

if errorlevel 2 goto two

:two

start /wait screen2.exe

if errorlevel 3 goto end

if errorlevel 2 goto three

if errorlevel 1 goto one

:three

start /wait screen3.exe

if errorlevel 3 goto end

if errorlevel 2 goto four

if errorlevel 1 goto two

:four

start /wait screen4.exe

if errorlevel 3 goto end

if errorlevel 2 goto five

if errorlevel 1 goto three

:five

start /wait screen5.exe

if errorlevel 3 goto end

if errorlevel 2 goto six

if errorlevel 1 goto four

:six

start /wait screen6.exe

if errorlevel 3 goto end

if errorlevel 2 goto seven

if errorlevel 1 goto five

:seven

start /wait screen7.exe

if errorlevel 3 goto end

if errorlevel 2 goto six

if errorlevel 1 goto end

:end

Link to comment
Share on other sites

i've got 7 screens with back and next buttons on them, back exits with code 1 next exits with code 2

then i create this setup.au3 file to load the screens and allow back and forward

only problem is i cant read the exit codes, i get unknown macro @exitcode when i run this

Runwait ("screen1.exe")

Runwait ("screen2.exe")

if @exitcode = 0 Then exit

if @exitcode = 1 Then Runwait ("screen1.exe")

if @exitcode = 2 Then Runwait ("screen3.exe")

Example:

$val = Runwait ("screen1.exe")
if $val = 0 then exit
$val = Runwait ("screen2.exe")
if $val = 0 then 
  exit
elseif $val = 1 then
   $val = Runwait("screen1.exe")
elseif $val = 2 then
   $val = Runwait("screen3.exe
endif

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Link to comment
Share on other sites

  • 2 months later...

Sorry to rip up in this thread but I just faced the same problem as Qual-IT London and did it the same way as him.

I solved my problem reading this thread but why is it not possible to directly use if @exitcode = 1 then blah???

Link to comment
Share on other sites

  • Developers

Sorry to rip up in this thread but I just faced the same problem as Qual-IT London and did it the same way as him.

I solved my problem reading this thread but why is it not possible to directly use if @exitcode = 1 then blah???

@ExitCode is used internally to be able to check inside Function OnAutoItExit () what the value is as defined by Exit().

Check for "Func OnAutoItExit()" for more info .. :)

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...