bingobingo Posted March 9, 2009 Posted March 9, 2009 im running autoit in the cmd through perl. how can i get an autoit script to return values when run through the command line?
Zedna Posted March 9, 2009 Posted March 9, 2009 Exit(3) returns 3 as return code to parent process Resources UDF ResourcesEx UDF AutoIt Forum Search
KaFu Posted March 9, 2009 Posted March 9, 2009 Compile as CUI, consolewrite should do $i = 0 while 1 sleep(1000) $i += 1 ConsoleWrite("Line " & $i & @crlf) wend OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2025-May-18) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16)
bingobingo Posted March 9, 2009 Author Posted March 9, 2009 Exit(3) returns 3 as return code to parent process but i get 768. ?
/dev/null Posted March 9, 2009 Posted March 9, 2009 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.CheersKurt __________________________________________________________(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 *
bingobingo Posted March 9, 2009 Author Posted March 9, 2009 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.CheersKurtsweet, it works, thanks a lot.but what if i want to return multiple values?when i do Exit (5,6)i get an error.
/dev/null Posted March 9, 2009 Posted March 9, 2009 (edited) 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.au3ConsoleWrite("Hello Test");exit(3);Perl: exit.plmy $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.au3ConsoleWrite("5,6");exit(3);CheersKurt Edited March 9, 2009 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 *
bingobingo Posted March 9, 2009 Author Posted March 9, 2009 Exit() has only one parameter. Here is a possible solution.AU3: test_exit.au3ConsoleWrite("Hello Test");exit(3);Perl: exit.plmy $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.au3ConsoleWrite("5,6");exit(3);CheersKurtthanks all, i got it.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now