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.

STRETCH When the Stretch property of an image control is set to False (the default value),<br />

the image control will hold the picture at its normal size. If the Stretch property is set to True,<br />

the picture will be resized to fit the image control<br />

STRING A variable of type String can hold a string of up to 32,767 characters. String values<br />

are enclosed in quotes: “January 1, 2001”. String variables can be indicated by the type<br />

tag $: FirstName$. A variable of type String*n holds a string of n characters, where n is a<br />

whole number from 1 to 32,767. Variables of this type have no type tag <strong>and</strong> must be declared<br />

in a Dim, Global, or Static statement. Until assigned a value, these variables contain a string<br />

of n Chr(0)’s.<br />

STRING If n is a whole number from 0 to 32767, the value of String(n, str) is the string consisting<br />

of the first character of str repeated n times. If m is a whole number from 0 to 255,<br />

the value of the function String(n, m) is the string consisting of the character with ANSI<br />

value m repeated n times.<br />

STYLE The Style property of a combo box determine whether the list is always visible<br />

(Style = 1) or whether the list drops down when the user clicks on the arrow <strong>and</strong> then disappears<br />

after a selection is made (Style = 0).<br />

SUB/END SUB A Sub procedure is a multistatement block beginning with a statement of<br />

the form Sub ProcedureName(parList), followed on subsequent lines by one or more statements<br />

for carrying out the task of the Sub procedure, <strong>and</strong> ending with the statement End Sub.<br />

The parameter list parList is a list of variables through which values will be passed to the<br />

Sub procedure whenever the function is called. (See the discussion of Call.) Parameters may<br />

be numeric or (variable-length) string variables as well as arrays.<br />

TAB The function Tab(n) is used in Print <strong>and</strong> Print# statements to move the cursor to position<br />

n <strong>and</strong> place spaces in all skipped-over positions. If n is less than the cursor position, the<br />

cursor is moved to the nth position of the next line.<br />

TABINDEX The property TabIndex determines the order in which the tab key moves the<br />

focus about the objects on a form. <strong>Visual</strong> <strong>Basic</strong> automatically assigns successive tab indexes<br />

as new controls are created at design time. <strong>Visual</strong> <strong>Basic</strong> also automatically prevents two<br />

controls on the same form from having the same tab index by renumbering controls with<br />

higher tab indexes when the designer or program directly assigns a new tab index to a control.<br />

TAN For any number x (except for x = p/2, –p/2, 3 * p/2, –3 * p/2, <strong>and</strong> so on), the value of<br />

the trigonometric function Tan(x) is the tangent of the angle of x radians. [radians]<br />

TEXT For a text box, the Text property holds the information assigned to a text box. A statement<br />

of the form textBoxName.Text = str changes the contents of textBoxName to the string<br />

specified by str. A statement of the form str = textBoxName.Text assigns the contents of<br />

textBoxName to str. For a list or combo box, control.Text is the contents of the currently<br />

highlighted item or the item in the text box, respectively. For a grid, MSFlexGrid1.Text is the<br />

contents of the active cell.<br />

TEXTHEIGHT This method applies to forms, picture boxes, <strong>and</strong> printer objects. The value<br />

of the method objectName.TextHeight(str) is the amount of vertical space required to display<br />

the contents of str using the font currently assigned for objectName. These contents may<br />

include multiple lines of text resulting from the use of carriage-return/line-feed pairs<br />

(Chr(13) + Chr(10)) in str. The units of height are those specified by the ScaleMode <strong>and</strong><br />

ScaleHeight properties of objectName. (The default is twips.)<br />

TEXTWIDTH This method applies to forms, picture boxes, <strong>and</strong> printer objects. The value<br />

of the method objectName.TextWidth(strVar) is the amount of horizontal space required to<br />

display the contents of strVar using the font currently assigned for objectName. When carriage<br />

return/line feed pairs (Chr(13) + Chr(10)) create multiple lines in strVar, this will be<br />

the space required for the longest line.<br />

Appendix C 451

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

Saved successfully!

Ooh no, something went wrong!