Creating a Link to Your COBOL Object

To place your COBOL application on your Web page for use with a helper application or viewer, you create a hyperlink by placing the HTML Anchor tags in your HTML document. End users who visit your Web page can then run the program by clicking on the program's link.

The HTML Anchor tags, <A> and </A>, are closed elements that, when combined with the HREF attribute, highlight text or images, making them clickable. When users click on a highlighted item on your Web page, they are transferred to the linked document. Since the link in this case is a COBOL program, when users click on the highlighted item, the COBOL program is automatically invoked. (See any commercially available HTML text for more information on anchors and hypertext links.)

To turn text into a hypertext anchor, enclose the clickable text in the Anchor tags. The browser usually displays this text underlined and in a different color. For example, your HTML document may include this:

<A HREF="myprog.acu">Click here to run the application</A>

The HREF attribute is used within the starting anchor tag to specify the document to be linked (or retrieved). Then when the user clicks on the highlighted text, "Click here to run the application," on your Web page, the COBOL object "myprog.acu" is retrieved from the specified location on the Web server and run in a normal ACUCOBOL-GT window.

To use images as hypertext anchors, you place the <IMG> element within the Anchor tags. For example:

<A HREF="myprog.acu">
<IMG SRC="myprog.gif" ALT="Click here to run the application">
</A>

Then when the user clicks on the "myprog.gif" image on your Web page, the COBOL object "myprog.acu" is retrieved from the specified location on the Web server and run in a normal ACUCOBOL-GT window. While the graphic file is loading (or if the user's browser does not support images), the browser displays the alternate text, "Click here to run the application". Clicking this text invokes the application as before.