Using the <EMBED> Tag

You can use the HTML <EMBED> tag to embed your COBOL application in the HTML document. Using this tag, you define a rectangular area within your Web page that your COBOL application should use as its initial "window."

When you include a configuration file in the library, you must also specify the name of the file using the OPTIONS attribute of the <EMBED> element. This ensures that the application uses the correct configuration file rather than defaulting to another that may reside on the user's system. You can also specify runtime options using the OPTIONS keyword. The following options are valid for the Web runtime: "-c", "-d", "-e", "-l", "-v", or "-x".

For example:

<EMBED SRC="myprog.acu" WIDTH=400 HEIGHT=200 
   OPTIONS="-c cblconfi -dlex myerrs">

embeds "myprog.acu" on the Web page and makes it accessible using the Web runtime, with configuration file "cblconfi" and various options. In this example, "myprog.acu" could be an entire COBOL application, or it could be the initial COBOL object of a distributed application using AcuServer or AcuConnect, or it could be the name of a library file.

When a user visits this Web page, the embedded object ("myprog.acu") is automatically sent from the Web server to the client machine where it immediately starts running inside the user's browser window. Configuration variables are read from the configuration file "myconfig", and errors are written to the error file "myerrs".

While the COBOL object or library is downloading and after the COBOL program exits, the control displays a splash screen in the browser window. You can disable this feature by setting the AcuShowLogo property to FALSE.

Please note that your application is not able to display its own main window menu bar when running inside a browser window. If you choose to use this method, you must program another way for your users to access your menu functions.

When invoking the Web runtime with the <EMBED> element, you can also specify runtime options and other properties using the AcuOptions attribute of the object interface.

If, for example, you want to specify both a configuration file and error file for the Web runtime, you could use:

<EMBED SRC="myprog.acu" WIDTH=400 HEIGHT=200 
   AcuOptions="-c cblconfi -e errors.txt">

The following code demonstrates using the property for instant debugging with the Web runtime:

   HEIGHT=384 WIDTH=512 AcuOptions="-d">

These examples assume that the Web runtime has been installed and registered. When you use the <EMBED> tag, the Web runtime is not automatically downloaded, as it may be when you specify the CODEBASE attribute and a valid URL with the <OBJECT> element.

Do not use the AcuProgram property when the ACUCOBOL-GT object is accessed via a URL. See Web runtime object interface for more information.