Functions and Statements in Visual Basic 6.0 (I-K)

If...Then...Else Statement

If condition Then [statements] [Else elsestatements]

or

If condition Then
    [statements]
[ElseIf condition-n Then
    [elseifstatements] ...
[Else
    [elsestatements]]
End If

Conditionally executes one or more statements if the value expressed by condition is True. One or more ElseIf clauses can be included to test other conditions and execute other statements (elseifstatements) if the preceding condition is False. An Else clause can also be included to execute other statements (elsestatements) if none of the preceding conditions are True.

IIf Function

IIf(expression, truepart, falsepart)

Returns one of two values based on whether expression evaluates to True or False. If True, then IIf returns the truepart value; if False, then the falsepart value is returned.

IMEStatus Function

IMEStatus

Returns an Integer value that represents Windows' current Input Method Editor (IME) mode. IMEStatus is only available in Far East versions.

Implements Statement

Implements [interfacename | class]

Specifies an interface (interfacename) or class (class) that will be implemented in the class module in which the Implements statement is used.

Input # Statement

Input #filenumber, varlist

Reads data from the open file associated with the filenumber argument and places it in the variables in the varlist argument. The varlist argument should contain one or more comma-delimited variables.

Input Function

Input(number, [#]filenumber)

Returns a String value containing characters read in from the open file that corresponds to the filenumber argument. The number of characters to be read in are specified by the number argument.

InputBox Function

InputBox(prompt[, title][, default][, xpos][, _ ypos][,helpfile, context])

Displays a dialog box and waits for the user to enter text or click a button; then returns what the user entered in a String value. The prompt argument specifies the message to be displayed in the dialog box, title specifies an optional caption for the dialog box's title bar, and default specifies the optional default value returned by the InputBox function if no value is entered by the user. The optional xpos and ypos arguments specify (in twips) the horizontal and vertical position of the dialog box on the screen. The optional helpfile and context arguments are used to provide context-sensitive Help for the dialog box.

InStr Function

InStr([start, ]string1, string2[, compare])

Returns a Variant of subtype Long that specifies the starting position of the first occurrence of a substring (string2) within another string (string1). The optional start argument specifies from which character in string2 to start searching; the default is 1 (first character). The optional compare argument specifies the type of string comparison that will be made (0 for binary or 1 for textual noncase-sensitive).

Int Function

Int(number)

Returns the integer portion of the number specified by the number argument. If number is negative, then Int returns the first negative integer less than or equal to number.

IPmt Function

IPmt(rate, per, nper, pv[, fv[, type]])

Returns a Double value that indicates the interest payment for a fixed-period annuity based on a number (nper) of periodic fixed payments (per) and a fixed interest rate (rate). The pv argument specifies the present value of a series of payments or receipts. The optional fv argument specifies the future value or cash balance left after the final payment. The optional type argument specifies when payments are due (0 for end of the payment period, the default; 1 for beginning of the payment period).

IRR Function

IRR(values()[, guess])

Returns a Double value indicating the internal rate of return for an array of values that represent cash flow. The values() array must contain at least one negative value (payment) and one positive value (receipt). The optional guess argument specifies an estimate value to be returned by IRR (default estimate is .1).

IsArray Function

IsArray(varname)

Returns a Boolean value that indicates whether the variable specified by varname is an array.

IsDate Function

IsDate(expression)

Returns a Boolean value that indicates whether expression is capable of being converted to a date value.

IsEmpty Function

IsEmpty(expression)

Returns a Boolean value that indicates whether a numeric or string expression has been initialized.

IsError Function

IsError(expression)

Returns a Boolean value that indicates whether a given expression is an error value.

IsMissing Function

IsMissing(argname)

Returns a Boolean value that indicates whether an optional Variant argument (argname) has been passed to a procedure. IsMissing returns True if no value has been provided for the specified argument.

IsNull Function

IsNull(expression)

Returns a Boolean value that indicates whether a given expression contains no data and is Null.

IsNumeric Function

IsNumeric(expression)

Returns a Boolean value that indicates whether a given expression can be evaluated as a numeric value.

IsObject Function

IsObject(identifier)

Returns a Boolean value that indicates whether a given identifier represents an object variable.

Kill Statement

Kill pathname

Deletes the file(s) or directory represented by the pathname argument. Filenames in the pathname argument can contain wildcards, allowing multiple files to be deleted.

No comments: