| Previous | Contents | Index |
| Attribute | Function |
|---|---|
| name | the symbolic name of the text entry field |
| rows | the number of rows (vertical height in characters) of the text entry field |
| cols | the number of columns (horizontal width in characters) of the text entry field |
| Example 9-23 <textarea >... </textarea > tag |
|---|
form_box$ = '<form>' form_box$ = form_box$ + '<textarea name=comments rows=10 cols=30>' form_box$ = form_box$ + 'Please type your comments in here.' form_box$ = form_box$ + '</textarea>' form_box$ = form_box$ + '</form>' input dialogbox form_box$: choice$ end |
9.4.3 Formatting Tags
9.4.3.1 CENTER
The CENTER tag defines text that should be centered.
| Example 9-24 <center >... </center > tag |
|---|
test$ = '<form>' test$ = test$ + '<center><b><h3>Book Request Form</center></h3></b><p>' test$ = test$ + 'Title: <input type=text name=title size=46><br>' test$ = test$ + 'Author: <input type=text name=author size=45>' form$ = test$ + '</form>' input dialogbox test$: answer$ end |
The PARAGRAPH tag starts a new paragraph by separating one paragraph from another with white space. The </P> tag is optional if the tag is only to insert space between two paragraphs, but vital when attributes (for example, ALIGN="center") are to apply to the whole paragraph. The ALIGN attribute can be one of LEFT, RIGHT, or CENTER.
| Example 9-25 <p >... </p > tag |
|---|
text$ = '<form>' text$ = text$ + '<b>Paragraph Example</b>' text$ = text$ + '<p>The following paragraphs will ' text$ = text$ + 'illustrate the left, right and center attributes to the ' text$ = text$ + 'paragraph tag.' text$ = text$ + '<p align=left>' text$ = text$ + 'This Agreement is governed by, and construed in accordance with, ' text$ = text$ + 'the laws of the State of California, without regard to your actual state or ' text$ = text$ + 'country of residence. Any modification of any provision of this Agreement will' text$ = text$ + ' be effective only if in writing and signed by TTI.</p>' text$ = text$ + '<p align=right>' text$ = text$ + 'If, for any reason, a court of competent jurisdiction ' text$ = text$ + 'finds any provision or portion of this Agreement to be unenforceable, the remainder ' text$ = text$ + 'of this Agreement will continue in full force and effect.</p>' text$ = text$ + '<p align=center>' text$ = text$ + 'This Agreement constitutes the entire agreement between ' text$ = text$ + 'you and TTI, with respect to the subject matter at hand. This Agreement supersedes ' text$ = text$ + 'and replaces all other understandings or agreements, written or oral, regarding such ' text$ = text$ + 'subject matter.</p>' input dialogbox text$: answer$ end |
The LINE BREAK tag breaks the current line of text. There is no </br> tag.
| Example 9-26 <br > tag |
|---|
test$ = '<form>' test$ = test$ + '1<br>2<br>3<br>4<br>5<br>6<br>7<br>8<br>9<br>10' test$ = test$ + '</form>' input dialogbox test$: answer$ end |
The ORDERED LIST tag introduces an ordered (numbered) list, which is made up of List Item (LI) tags.
| Example 9-27 <ol >... </ol > tag |
|---|
nlist$ = '<form>' nlist$ = nlist$ + '<ol>' nlist$ = nlist$ + '<li>This is the first item' nlist$ = nlist$ + '<li>This is the second item' nlist$ = nlist$ + '<li>This is the third item' nlist$ = nlist$ + '<li>This is the fourth item' nlist$ = nlist$ + '</ol>' nlist$ = nlist$ + '</form>' input dialogbox nlist$: example$ end |
The UNORDERED LIST tag introduces an unordered (bulleted) list, which is made up of List Item (LI) tags.
| Example 9-28 <ul >... </ul > tag |
|---|
blist$ = '<form>' blist$ = blist$ + '<ul>' blist$ = blist$ + '<li>This is the first item' blist$ = blist$ + '<li>This is the second item' blist$ = blist$ + '<li>This is the third item' blist$ = blist$ + '<li>This is the fourth item' blist$ = blist$ + '</ul>' blist$ = blist$ + '</form>' input dialogbox blist$: example$ end |
The HORIZONTAL RULE tag causes a horizontal line to be drawn across the screen. There is no </hr> tag.
| Example 9-29 <hr > tag |
|---|
form$ = '<form>' form$ = form$ + '<center><h2>Horizontal Rule Illustration</h2></center>' form$ = form$ + '<p><hr width=50%><p>' form$ = form$ + '<p><hr width=75% size=5><p>' form$ = form$ + '<p><hr size=10><p>' form$ = form$ + '</form>' input dialogbox form$: ans$ end |
The INLINE IMAGE tag displays an image referred to by a URL. It must contain at least an SRC attribute.
| Example 9-30 <img > tag |
|---|
image$ = '<form>' image$ = image$ + '<img src="c:\sheerpower\samples\bluejay.jpg"><p>' image$ = image$ + '<font color=blue>Can you name this bird?</font>' image$ = image$ + '<input type=text name=birdname>' image$ = image$ + '</form>' input dialogbox image$: source$ end |
| Attribute | Function |
|---|---|
| src="URL" | URL identifies the image source |
| width="number" | number specifies the width of the image in pixels |
| height="number" | number specifies the height of the image in pixels |
| border="number" | number is the border thickness in pixels |
| align="alignment" | alignment left or right for horizontal alignment; top, texttop, middle, center, bottom and baseline for vertical alignment |
| Example 9-31 <img > attributes tag |
|---|
// A simple quiz program
woodpecker$ = 'sheerpower:samples\woodpecker.jpg'
quiz_form$ = '<sheerpower persist><title>Quiz</title><form>' +
'<center><h3>Skill Testing Question</center></h3>' +
'<img src="' + woodpecker$ + '" border=3 align=middle>'
quiz_form$ = quiz_form$ + '<font color=green> ' +
'<b>What type of woodpecker' +
' is in this photograph?</b></font><p>'
quiz_form$ = quiz_form$ + '<input type=radio name=birdname ' +
'value="Pileated Woodpecker"> ' +
'<i>Pileated Woodpecker<p>'
quiz_form$ = quiz_form$ + '<input type=radio name=birdname ' +
'value="Hairy Woodpecker"> Hairy Woodpecker<p>'
quiz_form$ = quiz_form$ + '<input type=radio name=birdname ' +
'value="Redheaded Woodpecker"> ' +
'Redheaded Woodpecker</i></b>'
quiz_form$ = quiz_form$ + '<p><input type=submit name=submit value="Submit">' +
'<input type=submit name=exit>' +
'</form>'
correct$ = 'Hairy Woodpecker'
good$ = '<sheerpower width=400 height=170 color=green>' +
'<form><h1>Congratulations!! ' +
correct$ + ' is the correct answer!!</h1>' +
'<p><input type=submit></form>'
do
input dialogbox quiz_form$: ans$
if _exit then stop
value$ = element$(ans$, 2, '=')
if value$ = correct$ then exit do
message error: "Sorry, this is not a ";value$
loop
input dialogbox good$: ans$
end
|
| Previous | Next | Contents | Index |