ContentsIndexPreviousNext

5.5.1.2 Running your program in a separate application window

If you want your COBOL program to start automatically in a separate window, you can do so by taking advantage of the standard runtime executable, "wrun32.exe", that is included with the plug-in. Specifically, you program the plug-in to launch the standard runtime in a separate window. To do this, add "SEPARATE=1" to your HTML <EMBED> tag. You may also specify "HIDDEN="TRUE"" if you do not want the plug-in to occupy any screen space on your web page. For example,

     <EMBED src="http://myserver/myapps/myprog.acu" SEPARATE=1 HIDDEN="TRUE">

causes the browser to download the "myprog.acu" file and load the ACUCOBOL-GT plug-in. The plug-in then immediately launches the standard runtime in a separate window to execute the program.

The plug-in actually makes a copy of the program first and executes it with the standard runtime. When the runtime finishes executing the program, it deletes the copy of the object. This is necessary because the browser might delete the original from its cache directory before the runtime is finished using it.

Note that when you specify "SEPARATE=1" in the <EMBED> tag, the plug-in always tries to run the program in a separate runtime process. The standard runtime runs in a special mode when it is executed by the plug-in. In this mode, the runtime has all of the security features of the plug-in. It also has all of the restrictions of the plug-in except for one. Because it is running in a separate window, it will display and operate a menu bar. It has all of the features of the plug-in except for two: W$GETURL and W$STATUS are not available.

In this mode, you may embed several COBOL programs in a single Web page or Web site. Each program runs in a separate runtime instance on the client machine. These instances do not shut down when the user presses the browser's back button or when the browser shuts down. Multiple instances occur whenever two or more ".acu" files are embedded in a browser window or in separate browser windows that are part of a single browser process.