olliwest
28th April 2008, 17:51
hello together,
i like to set an OS (Windows) exit code with an baan ln script, has everbody experience with this? Is this possible??
e.g.
function set.exit.code()
{
if xxx< yyy then
if xxx > yyy then
rt = app_start("cmd.exe","","c:\set_exit1.bat","","")
|exit (1)
else
rt = app_start("cmd.exe","c:\dienste\","set_exit0.bat","","")
|exit(0)
endif
else
rt = app_start("cmd.exe","c:\dienste\","set_exit2.bat","","")
|exit(2)
endif
}
thanks
;-)
NPRao
28th April 2008, 19:50
olliwest,
Refer to the tools programmer's manual for more info -
function long app_start (string commandline, string directory, string stdin, string stdout, string stderr)
Description
Deprecated. This function is only supported for Baan Windows and its usage is therefore deprecated. Instead you should use function: start.application.local().
This starts the application specified in the commandline argument. It returns an ID for the started application. You can subsequently use this ID as the app.id argument in the app_status() function.
function boolean start.application.local (string commandline, boolean waitFlag, ref long exitCode [, const string verb])
Arguments
string commandline This specifies the command that starts the application. If commandline does not include a directory path, Windows searches for the executable file in the following directories, in the order shown below:
The Windows system directory.
The Windows directory.
The directories listed in the PATH environment variable.
This argument may also contain the full pathname of a local document. In this case the application associated with this document extension will be started.
The commandline parameter may one or more times include the string ${BSE_TMP} which indicates the ${BSE}\tmp directory in case of Baan Windows or Windows temp directory in case of Webtop.
boolean waitFlag Indicates whether the application must wait for the local application to exit.
ref long exitCode Exit code of local application. Only contains a valid exit code when the waitFlag attribute was true
[const string verb ] When the commandline argument contains a document pathname, the optional verb argument may contain the action to be performed on this document. The default action is "open". Another useful verb is: "print". In case this argument is supplied, the waitFlag argument will be ignored and the execution will always by asynchronous.