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.

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

TIME The value of the function Time is the current time expressed as a string of the form<br />

hh:mm:ss. (The hours range from 0 to 23, as in military time.) If timeStr is such a string, the<br />

statement Time = timeStr sets the computer’s internal clock to the corresponding time.<br />

TIMER The value of the function Timer is the number of seconds from midnight to the time<br />

currently stored in the computer’s internal clock.<br />

TIMER The Timer event is triggered by the passage of the amount of time specified by the<br />

Interval property of a timer control whose Enabled property is set to True.<br />

TIMESERIAL The value of the function TimeSerial(hour, minute, second) is the serial date<br />

corresponding to the given hour, minute, <strong>and</strong> second. Values from 0 (midnight) to 23 (11<br />

p.m.) for hour, <strong>and</strong> 0 to 59 for both minute <strong>and</strong> second are normal, but any Integer value may<br />

be used. Often, numeric expressions are used for hour, minute, or second that evaluate to<br />

numbers outside these ranges. For example, TimeSerial(15–5, 20–30, 0) is the serial time 5<br />

hours <strong>and</strong> 30 minutes before 3:20 p.m.<br />

TIMEVALUE The value of the function TimeValue(str) is the serial date corresponding to<br />

the time given in str. TimeValue recognizes both the 24-hour <strong>and</strong> 12-hour time formats:<br />

“13:45:24”or “1:45:24PM”.<br />

TOP The property Top determines the position of the top edge of a form or control. The units<br />

of measure are twips for forms. The units of measure for a control are determined by the<br />

ScaleMode property of the container (form, picture box, etc.) on which the control has been<br />

placed, with the position of the control measure from the edge of its container using the coordinate<br />

system established by the various Scale... properties for the container. By default, the<br />

unit of measure for a container is twips, with a value of 0 for the Top property placing the<br />

control against the top edge of the container.<br />

TRIM The value of the function Trim(str) is the string obtained by removing all the spaces<br />

from the beginning <strong>and</strong> end of the string str. The string str may be either fixed-length or variable-length.<br />

TRUE A keyword of the Boolean type. True is used when setting the value of properties that<br />

are either True or False. For example, Picture1.Font.Italic = True.<br />

TYPE/END TYPE A multistatement block beginning the Type typeName <strong>and</strong> ending with<br />

End Type creates a user-defined record type. Each statement inside the block has the form<br />

elt As type, where elt is a variable <strong>and</strong> type is either Integer, Boolean, Byte, Date, Long, Single,<br />

Double, Currency, Variant, String*n (that is, fixed-length string), or another user-defined<br />

record type. After a statement of the form Dim var As typeName appears, the element corresponding<br />

to the statement elt As type is referred to as var.elt. Type declaration blocks must<br />

be placed in the (Declarations) section of a BAS module. [variant]<br />

TYPENAME If var is variable, then the value of the function TypeName(var) is a string<br />

identifying the type of the variable. The possible values of the function are Byte, Integer,<br />

Long, Single, Double, Currency, Date, String, Boolean, Error, Empty (uninitialized), Null<br />

(no valid data), Object (an object that supports OLE Automation), Unknown (an OLE<br />

Automation object whose type is unknown), <strong>and</strong> Nothing (an object variable that doesn’t<br />

refer to an object).<br />

UBOUND For a one-dimensional array arrayName, the value of the function<br />

UBound(arrayName) is the largest subscript value that may be used. For any array array-<br />

Name, the value of the function UBound(arrayName, n) is the largest subscript value that<br />

may be used for the nth subscript of the array. For example, after the statement Dim example(1<br />

To 31, 1 To 12, 1990 To 1999) is executed, the value of UBound(example, 3) is the<br />

largest value allowed for the third subscript of example( ), which is 1999.<br />

UCASE The value of the string function UCase(str) is a string identical to str except that all<br />

lowercase letters are changed to uppercase.

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

Saved successfully!

Ooh no, something went wrong!