contents.gifindex.gifprev1.gifnext1.gif

W$GETURL

If desired, you can enhance your COBOL program to give your end user access to other Web pages and the ability to send e-mail messages, conduct Web searches, and execute JavaScript. You determine how much functionality you want to give to your end users, and you code those functions into your application by passing URLs (universal resource locators) to the Web browser with the new W$GETURL library function.

The W$GETURL library routine tells the runtime to pass a given URL to the host browser. The browser will handle the URL as if it were typed in the URL entry field.

Each URL that you pass with the W$GETURL routine contains a protocol and a path, separated by a colon. For example, http://www.acucorp.com/ tells the browser to use the HyperText Transfer Protocol and to contact the Web server "www.acucorp.com" and to ask for the root page (/).

Sending e-mail uses the "mailto" protocol. For example, mailto:support@acucorp.com opens an e-mail message to the user "support" at the machine "acucorp.com".

JavaScript is also supported as a protocol, so you can execute JavaScript sequences that display dialog boxes, create Web pages, build text files, and much more.

Use this library routine as follows:

CALL "W$GETURL" USING URL, TARGET

where URL, PIC X(n), contains the complete URL. This can be of any type, such as http, ftp, news, mailto, gopher, or javascript.

and TARGET, PIC X(n), represents the destination for displaying the URL. This can be a window or a frame. If you specify "_current", "_self" or "_top", the response data is written to the plug-in window, and the plug-in is unloaded. If you specify "_blank" or "_new", the response data is written to a new browser window. You can also write the response data to a frame by specifying the frame name as the target parameter.

After a CALL is made to W$GETURL, subsequent URL requests are ignored until the CALL completes.

Note: This routine is only available when the calling COBOL program is running in a Web browser window via the ACUCOBOL-GT Web Plug-in. This routine is unavailable to programs run by the standard runtime when it is executed by a Web browser. The RETURN-CODE register is set to "1" after a successful call and "0" if this routine is unavailable.