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.

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

button. After you click on Debug, the line containing the offending word will<br />

be highlighted.<br />

7. At design time, colors are selected from a palette. At run time, the eight most<br />

common colors can be assigned with the color constants vbBlack, vbRed,<br />

vbGreen, vbYellow, vbBlue, vbMagenta, vbCyan, <strong>and</strong> vbWhite. For instance,<br />

the statement<br />

picBox.BackColor = vbYellow<br />

gives picBox a yellow background.<br />

8. For statements of the form object.property = setting, with properties Caption,<br />

Text, or Font.Name, the setting must be surrounded by quotes. (For instance,<br />

lblTwo.Caption = “Name”, txtBox.Text = “Fore”, <strong>and</strong> picBox.Font.Name =<br />

“Courier”.) When the words True or False appear to the right of the equal sign,<br />

they should not be surrounded by quotation marks.<br />

9. Code windows have many features of word processors. For instance, the operations<br />

cut, copy, paste, find, undo, <strong>and</strong> redo can be carried out with the sixth<br />

through eleventh icons of the Toolbar. These operations, <strong>and</strong> several others, also<br />

can be initiated from the Edit menu.<br />

10. Names of existing event procedures associated with an object are not automatically<br />

changed when you rename the object. You must change them yourself <strong>and</strong><br />

also must change any references to the object. Therefore, you should finalize<br />

the names of your objects before you put any code into their event procedures.<br />

11. If you find the automatic List Properties/Methods feature distracting, you can<br />

turn it off by pressing Tools/Options, selecting the Editor page, <strong>and</strong> clicking on<br />

Auto List Members. If you do so, you can still display a list manually at the<br />

appropriate time by pressing Ctrl+J.<br />

12. Earlier versions of <strong>Visual</strong> <strong>Basic</strong> used the property FontSize instead of<br />

Font.Size. Although Font.Size is preferred, FontSize is allowed for compatibility.<br />

Similarly, properties such as FontBold, FontItalic, <strong>and</strong> FontName have been<br />

included for compatibility with earlier versions of <strong>Visual</strong> <strong>Basic</strong>.<br />

13. Assignment statements can be written preceded with the keyword Let. For<br />

instance, txtBox.Text = “Hello” also can be written Let txtBox.Text =<br />

“Hello”. Therefore, assignment statements are also known as Let statements.<br />

2.3 NUMBERS<br />

Much of the data processed by computers consists of numbers. In “computerese,” numbers are<br />

often called numeric constants. This section discusses the operations that are performed with<br />

numbers <strong>and</strong> the ways numbers are displayed.

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

Saved successfully!

Ooh no, something went wrong!