execbg

Purpose

Executes an executable program in the background and returns the process id to GAUSS.

Format

pid = execbg(program, comline)
Parameters:
  • program (string) – the name of the program, including the extension, to be executed.

  • comline (string) – the arguments to be placed on the command line of the program being executed.

Returns:

pid (scalar) –

the process id of the executable returned by program.

If execbg() cannot execute program, the error returns will be negative:

-1

file not found

-2

the file is not an executable file

-3

not enough memory

-4

command line too long

Examples

pid = execbg("atog.exe", "comd1.cmd");

if (pid < 0);
   errorlog "atog failed";
   end;
endif;

In this example, the ATOG ASCII conversion utility is executed under the execbg(). The name of the command file to be used, comd1.cmd, is passed to ATOG on its command line. The returned value, pid, is tested to see whether ATOG was successful. If not successful the program terminates after printing an error message. See ATOG .