startapp函数与wscript.shell exec方法都可以用来打开windows应用程序。
(startapp "notepad.exe" "d:\\test.txt")
(vlax-invoke-method (vlax-get-or-create-object "wscript.shell") "exec" "notepad.exe d:\\test.txt")
上面的代码都是用记事本新建或打开文件。
编译成VLX时如果勾选了独立名称空间,也都能够编译成功。
运行编译后的程序时,
startapp函数会出错(no function definition: startapp参数类型错误: stringp nil),
wscript.shell exec方法则不会。