PDA

View Full Version : Get Return Code C++ in TCL


biboun
08-28-2004, 12:16 PM
I have an C++ code was return value for different error.

int main(int argc, char * argv[]) {

error 1 -> return 1 or exit(1);
error 2 -> return 2 or exit(2);
...
}

Question -> How can i get in TCL when I execute the exe file, the return value.

set status [catch {exec ..... } result ] return only if the fonction was successfull execute.

Any idea ? Thanks

FTPServerTools
08-30-2004, 03:21 AM
set status [exec - blahblah...] will set the return code tho.

tuff
08-30-2004, 04:45 AM
catch {set status [exec ....]} status

should also return any errors or your return code to $status

biboun
09-01-2004, 04:23 PM
Tks for your answers. It works fine.