Jump to content

autoit script returning values


Recommended Posts

but i get 768.

?

Run it like this:

perl -e "my $exitcode = system('exit_test.exe') >> 8; print $exitcode;"

You have to right shift the exit code for 8 bits. Then it's the correct value.

Cheers

Kurt

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Link to comment
Share on other sites

Run it like this:

perl -e "my $exitcode = system('exit_test.exe') >> 8; print $exitcode;"

You have to right shift the exit code for 8 bits. Then it's the correct value.

Cheers

Kurt

sweet, it works, thanks a lot.

but what if i want to return multiple values?

when i do Exit (5,6)

i get an error.

Link to comment
Share on other sites

sweet, it works, thanks a lot.

but what if i want to return multiple values?

when i do Exit (5,6)

i get an error.

Exit() has only one parameter. Here is a possible solution.

AU3: test_exit.au3

ConsoleWrite("Hello Test");

exit(3);

Perl: exit.pl

my $cmd = 'exit_test.exe';

open(PIPE, "$cmd |");

my $exit_line = <PIPE>;

close(PIPE);

print $exit_line;

Then parse the content of $exit_line.

EDIT: Or, to stick with your sample.

AU3: test_exit.au3

ConsoleWrite("5,6");

exit(3);

Cheers

Kurt

Edited by /dev/null

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Link to comment
Share on other sites

Exit() has only one parameter. Here is a possible solution.

AU3: test_exit.au3

ConsoleWrite("Hello Test");

exit(3);

Perl: exit.pl

my $cmd = 'exit_test.exe';

open(PIPE, "$cmd |");

my $exit_line = <PIPE>;

close(PIPE);

print $exit_line;

Then parse the content of $exit_line.

EDIT: Or, to stick with your sample.

AU3: test_exit.au3

ConsoleWrite("5,6");

exit(3);

Cheers

Kurt

thanks all, i got it.

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