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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

402 <strong>Computer</strong> <strong>Programming</strong> <strong>Concepts</strong> <strong>and</strong> <strong>Visual</strong> <strong>Basic</strong><br />

COMMENTS<br />

1. You can obtain extensive information about HTML <strong>and</strong> VBScript from the Help<br />

menu in the ActiveX Control Pad. (If the documentation for VBScript is not<br />

present on your computer, you can either download the documentation or read<br />

it online at http://microsoft.com/scripting.)<br />

2. HTML tags are not case sensitive. For instance, has the same effect as .<br />

3. A TITLE element must placed inside the HEAD portion of an HTML document.<br />

4. VBScript programs can contain code that is not in any procedure. If so, this<br />

code is executed by Internet Explorer as soon as the Web page is displayed. It<br />

is analogous to <strong>Visual</strong> <strong>Basic</strong> code found in the Form_Load event procedure.<br />

5. Some features of <strong>Visual</strong> <strong>Basic</strong> that are not available in VBScript are ranges of<br />

values <strong>and</strong> the Is keyword in Case clauses, Str <strong>and</strong> Val functions, the Open<br />

statement, On Error GoTo statement, arrays declared with lower bound ≠ 0, line<br />

labels, collections, <strong>and</strong> picture box controls.<br />

6. If i is the index of a For...Next loop, in <strong>Visual</strong> <strong>Basic</strong> the final statement should<br />

be Next i. In VBScript, the i must be dropped from the final statement.<br />

7. To download the ActiveX Control Pad, enter the address<br />

http://www.microsoft.com/gallery/tools/contents.htm into your browser <strong>and</strong><br />

follow the directions.<br />

8. You can place your own custom-built ActiveX controls into an HTML document<br />

provided the control has been compiled into an ocx file. However, in order<br />

to use these controls you will have to ease Internet Explorer's safety level. To<br />

invoke the lowest level of security, select Internet Options from Internet Explorer's<br />

View menu, click on the Security tab, <strong>and</strong> select Low. Note: Before you<br />

actually connect to the internet, reset the safety level to High.<br />

9. <strong>Visual</strong> <strong>Basic</strong> allows you to place controls exactly where you want on a form.<br />

The ActiveX Control Pad has a device, called an HTML Layout, that lets you<br />

achieve the same result. An HTML Layout is actually an ActiveX control that<br />

acts as a container for other controls. It has a grid like a form that allow for precision<br />

alignment. The steps for creating an HTML Layout are as follows.<br />

(a) From the ActiveX Control Pad, click on New HTML Layout in the File<br />

menu. (A form-like window <strong>and</strong> a square toolbar containing about a dozen<br />

icons will appear.)<br />

(b) Place a control on the Layout with the click <strong>and</strong> drag method. To set the<br />

properties of a control in the Layout, double-click on the control to produce<br />

a Properties window.<br />

(c) After all the controls have been drawn <strong>and</strong> their properties set, save the<br />

Layout (in an ALX file).<br />

(d) To insert the Layout into an HTML document, position the cursor at the<br />

insertion point, <strong>and</strong> click on Insert HTML Layout in the Edit menu to open<br />

a file-selection dialog box. Select the location <strong>and</strong> name of the file, <strong>and</strong><br />

then press the Open button. (An OBJECT element will be created for the<br />

Layout.)<br />

(e) Whenever you want to alter the Layout, place the cursor anywhere inside<br />

the OBJECT element <strong>and</strong> select Edit HTML Layout from the Edit menu.

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

Saved successfully!

Ooh no, something went wrong!