從Dmis調用外部可執行文件

從 ArcoWiki
跳到: 導覽搜尋

In order to Call An External Executable from Dmis the command to be executed is CALL/EXTERN,SYS.
The .EXE can be run with or without extra arguments.

External Program without argument

$$ This example open notepad, and suspends ARCO execution while Notepad is open

CALL/EXTERN, SYS, 'notepad.exe', WAIT'

External Program with one argument only

$$ This example open the c:\TEST.TXT file with notepad, and suspends ARCO execution while notepad is open

CALL/EXTERN, SYS, 'notepad.exe', WAIT, 'C:\TEST.TXT'

External Program with more arguments

$$ This example presents a .exe file with more argument, and runs independently from ARCO

CALL/EXTERN,SYS, 'exename.exe', CONT, 'arg1', 'arg2'

Parameters

The WAIT parameter SUSPENDS during the external program execution.
With WAIT parameter the External Program SUSPENDS ARCO until the execution is over

The CONT parameter DOESN'T SUSPENDS during the external program execution.
With CONT parameter the External Program runs independently.

Use of Blanks in File Name

If blanks are present in the file path, it is necessary to enclose the entire path between inverted commas.

$$Example of white characters in the path

CALL/EXTERN, SYS, '" D:\Visual Studio 2010\exename.exe"', WAIT, '" D:\Visual Studio 2010\arg1.txt"', '" D:\Visual Studio 2010\arg2.txt"'