HTML Procedures in SQR

Creating HTML output from SQR

 

To use the HTML procedures listed below, your program must reference the HTML procedures.

Issue the following two commands at the start of your program:

 

#include html.inc

do html_on

 

The file html.inc is located in the SAMPLE (or SAMPLEW) directory.  Use the command-line flag -I to indicate this location.

 

There are 6 types of HTML procedure that can be used to easily create HTML o/p files.

 

General Purpose Procedures

Heading Procedures

Highlighting Procedures

Hypertext Link Procedures

List Procedures

Table Procedures

 

Eg:-        

1) Html_br

 

Produces the specified number of line breaks in a paragraph using the HTML<BR> tag.

This causes the paragraph to be continued onto the next line.

 

Syntax: html_br(number count, string attributes)

 

count    = the number of HTML <BR> tags that are inserted.

            Attributes          =          the HTML attributes that are incorporated inside the HTML <BR> tag.

 

Example: Producing a line break:

            Print 'Here is some text' ()

            Do html_br (3,'')

            Print 'Here is some three lines down' ()

 

2) Inserts an image using the HTML <IMG> tag. This can also be done using the command PRINT-IMAGE;

However, the procedure html_img provides the ability to specify the full set of available HTML attributes.

 

Syntax:             html_img (string attributes)

 

Attributes          =          the HTML attributes that are incorporated inside the HTML <IMG> tag.

 

Some common attributes:

 

Src       =          URL of the image to be inserted (Ex:  src=/images/abc.gif)

Height =            height of the image in pixels (Ex:  height=200)

Width   =           width of the image in pixels (Ex:  width=400)

 

Example:          Producing an image:

 

Do html_img('src="/images/stop.gif"')

 

-Posted by

Ganesh A.M

 

 

0 comments: