sant123
10th February 2003, 18:33
I invoke an application(on unix platform) from Baan using Shell("./some_apps",0), and the some_apps returns a value how do I capture the return value of some_apps, I know the return values for Shell() is 0,1,2,3...., but I need the return values from the called function also. HOW DO I DO IT ( Apart from using the fileI/O).

Appreciate any help.

Santu.

ssbaan
11th February 2003, 17:22
Did you try something like below. I know if e is not zero you will get the error message, but I am not sure if e contains the actual return code from the shell.

functions:
function call.shell.script()
{
e = shell("./some_apps", SHELL_CLS + SHELL_CONFIRM)
if e then
message("Error: unable to execute ./some_apps script")
endif
}

NPRao
11th February 2003, 21:16
I am doubtful if there is any other way than using the File-I/O.

Please refer to - run.baan.prog(), run.prog() (http://www.baanboard.com/programmers_manual_baanerp_help_functions_starting_and_stopping_programs_run_baan_prog_run_prog)

stderr
Writes error messages to stderr.

Note
Output from the program cannot be displayed. If the -q switch is available, use this to output the program results to a file.

Use these functions instead of the shell() function used in previous versions of BAAN.