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.

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

IF (single line) A statement of the form If condition Then action causes the program to take<br />

the specified action if condition is true. Otherwise, execution continues at the next line. A<br />

statement of the form If condition Then action1 Else action2 causes the program to take<br />

action1 if condition is true <strong>and</strong> action2 if condition is false.<br />

IF TYPEOF To test for the type of a control when the control name is passed to a procedure,<br />

use If TypeOf controlName Is controlType Then action1 Else action2 in either the single line<br />

or block form of the If statement. ElseIf TypeOf is also permitted. For controlType, use one<br />

of the control names that appear in the Form Design ToolBox (Comm<strong>and</strong>Button, Label,<br />

TextBox, etc.)—for example, If TypeOf objectPassed Is Label Then. . . .<br />

IMP The logical expression condition1 Imp condition2 is true except when condition1 is<br />

true <strong>and</strong> condition2 is false. For example, (3”a”) is true because both 3”a”are true, <strong>and</strong> (“apple”>”ape”) Imp (“earth”> “moon”) is false because<br />

“apple”>”ape”is true but “earth”>”moon”is false. Imp is an abbreviation for “logically<br />

implies.”<br />

INDEX When a control is part of a Control array, it is identified by the number specified<br />

by its Index property.<br />

INPUT The statement strVar = Input(n, m) assigns the next n characters from the file with<br />

reference number m (opened in Input or Binary mode) to strVar.<br />

INPUT # The statement Input #n, var reads the next item of data from a sequential file that<br />

has been opened for Input with reference number n <strong>and</strong> assigns the item to the variable var.<br />

The statement Input #n, var1, var2, . . . reads a sequence of values <strong>and</strong> assigns them to the<br />

variables.<br />

INPUTBOX The value of the function InputBox(prompt) is the string entered by the user in<br />

response to the prompt given by prompt. The InputBox function automatically displays the<br />

prompt, a text box for user input, an OK button, <strong>and</strong> a Cancel button in a dialog box in the<br />

center of the screen. If the user selects Cancel, the value of the function is the null string (“”).<br />

For greater control, use the function InputBox(prompt, title, defaultStr, xpos, ypos), which<br />

places the caption title in the title bar of the dialog box, displays defaultStr as the default<br />

value in the text box, <strong>and</strong> positions the upper-left corner of the dialog box at coordinates<br />

(xpos, ypos) on the screen. [coordinate systems]<br />

INSTR The value of the function InStr(str1, str2) is the position of the string str2 in the<br />

string str1. The value of InStr(n, str1, str2) is the first position at or after the nth character<br />

of str1 that the string str2 occurs. If str2 does not appear as a substring of str1, the value is<br />

0.<br />

INT The value of the function Int(x) is the greatest whole number that is less than or equal<br />

to x.<br />

INTEGER A variable of type Integer requires 2 bytes of memory <strong>and</strong> can hold the whole<br />

numbers from –32,768 to 32,767. Integer values <strong>and</strong> variables may be indicated by the type<br />

tag %: 345%, Count%.<br />

INTERVAL The Interval property of a Timer control is set to the number of milliseconds (1<br />

to 65535) required to trigger a Timer event.<br />

ISDATE The value of the function IsDate(str) is True if the string str represents a date<br />

between January 1, 100 <strong>and</strong> December 31, 9999. Otherwise, the value is False. [date]<br />

ISEMPTY The value of the function IsEmpty(v) is True if v is a variable of unspecified type<br />

(that is, is a variant) that has not yet been assigned a value. In all other cases the value of<br />

IsEmpty is False. [variant]<br />

ISNULLThe value of the function IsNull(v) is True if v is a variant variable that has been<br />

assigned the special value Null. In all other cases the value of IsNull is False. [variant]

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

Saved successfully!

Ooh no, something went wrong!