Back Up Next

Creating Email and Web Site Links

You can enhance your 4GL modules to add features such as companies' URL or e-mail addresses.

The database contains records for the company's web site and E-mail address. For the browser to create a link on an address, the module must contain the following code:

<A HREF="mailto:support@informix.com">Send a mail to support</A>

To link to a new page:

<A HREF="http://www.informix.com">See our site !</A>

The 4GL code can be enhanced as follows to incorporate links that allow you to send email to the company or jump to the company's home page:

DEFINE l_buffer CHAR(500)

...

IF r_company.com_email IS NOT NULL THEN
  LET l_buffer = "<A HREF=\"mailto:",
    r_company.com_email CLIPPED,
    "\">",r_company.com_email CLIPPED, "</A>"
  DISPLAY l_buffer TO com_email
END IF

IF r_company.com_web IS NOT NULL THEN
  LET l_buffer = "<A HREF=\"http://",
    r_company.com_web CLIPPED, "\"
    TARGET=\"_blank\">", r_company.com_web CLIPPED, "</A>"
  DISPLAY l_buffer TO com_web
END IF

The following displays the results:

Enhance company

To send email, the user can click on the E-mail link. The Web field links to the company's web page.