19.12.2012 Views

Computer Programming Concepts and Visual Basic David I. Schneider

Computer Programming Concepts and Visual Basic David I. Schneider

Computer Programming Concepts and Visual Basic David I. Schneider

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

DownloadComplete Triggered when the download is complete, halter, or<br />

failed.<br />

5. If a file on your disk is an HTML document, you can view it as a web page with<br />

the statement WebBrowser1.Navigate “filespec”.<br />

6. Three good books about the Internet are<br />

C.L. Clark, A Student’s Guide to the Internet, Prentice Hall, Inc. 1996.<br />

B. P. Kehoe, Zen <strong>and</strong> the Art of the Internet, Prentice Hall, Inc. 1996.<br />

K. Hafner <strong>and</strong> M. Lyon, Where Wizards Stay Up Late: The Origins of the Internet,<br />

Simon & Schuster, 1996.<br />

13.3 WEB PAGE PROGRAMMING WITH VBSCRIPT<br />

Note: This section requires that the Internet Explorer Web browser be installed on your computer.<br />

Web browsers display Web pages created as text files, called HTML 1 [st<strong>and</strong>s for Hyper-<br />

Text Markup Language] documents. The text files can be written with Notepad or any other<br />

word processor. VBScript is a subset of the <strong>Visual</strong> <strong>Basic</strong> programming language that is used<br />

to make Web pages interactive. (You can use any VBScript code in VB itself.) In this section,<br />

we learn how to create Web pages with HTML, add controls to Web pages, <strong>and</strong> write<br />

VBScript code that manipulates the controls.<br />

■ HTML<br />

Here is a typical line in an HTML document.<br />

This sentence will be printed in bold.<br />

The items <strong>and</strong> are called tags. Here the letter B st<strong>and</strong>s for Bold <strong>and</strong> the pair of tags<br />

tells the browser to display everything between the two tags in boldface. The first tag is called<br />

the begin tag <strong>and</strong> the second tag is called the end tag. Most tags come in pairs in which the<br />

second tag differs from the first only in the addition of a slash (/). The combination of pair of<br />

tags <strong>and</strong> the data characters enclosed by them is called an element. In general, a tag defines<br />

a format to apply or an action to take. A pair of tags tells the browser what to do with the text<br />

between the tags. Some pairs of tags <strong>and</strong> their effect on the text between them are as follows.<br />

, Display the text in italics<br />

, Display the text underlined.<br />

, Display the text in a size n header (1 ≤ n ≤ 6)<br />

, Display the text one font size larger.<br />

, Display the text one font size smaller.<br />

, Center the text.<br />

, Place the text in the Web page title bar.<br />

An example of a tag that does not come in pairs is , which tells the browser to start<br />

a new paragraph <strong>and</strong> insert a blank line. A similar tag is which inserts a carriage return<br />

<strong>and</strong> a line feed to start a new line. The lines<br />

Line One<br />

Line Two<br />

in an HTML document will be displayed as<br />

Line One Line Two<br />

in the Web page, since browsers combine all the white space (including spaces, tabs, <strong>and</strong> line<br />

breaks) into a single space. On the other h<strong>and</strong>,<br />

Line One Line Two<br />

Web Page <strong>Programming</strong> With VBScript 397

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!