Log In    |    Knowledge Base    |    4D Home
Tech Tip: Launching an Application within 4D
PRODUCT: 4D Pack | VERSION: 2003 | PLATFORM: Mac & Win
Published On: May 27, 2004

You can launch an application or open a document within 4D using AP Sublaunch command of the 4D Pack Plug-in. Using this command is equivalent to opening or double-clicking the application. It takes the path to the application and the mode status as parameters. On Windows, there are three modes: mode 0 to display application window in normal mode; mode 1 to display window in full screen use mode; and mode 2 to display window as reduced in the taskbar. On the Mac, you can choose between asynchronous mode (0) and synchronous mode (1). The AP Sublaunch command returns 0 if successful, or an error code otherwise.
The code below opens a document with Notepad:

$errCode:=AP Sublaunch(“C:\\Windows\\Notepad.exe C:\\MyRecord.txt”, 1)