30
String expression displayed in the title bar of the dialog box. If you omit title, the application name is placed in the title bar.
default
String expression displayed in the text box as the default response if no other input is provided. If you omit default, the text box is
displayed empty.
xpos
Numeric expression that specifies, in twips, the horizontal distance of the left edge of the dialog box from the left edge of the screen. If
xpos is omitted, the dialog box is horizontally centered.
ypos
Numeric expression that specifies, in twips, the vertical distance of the upper edge of the dialog box from the top of the screen. If ypos
is omitted, the dialog box is vertically positioned approximately one-third of the way down the screen.
helpfile
String expression that identifies the Help file to use to provide context-sensitive Help for the dialog box. If helpfile is provided, context
must also be provided.
context
Numeric expression that identifies the Help context number assigned by the Help author to the appropriate Help topic. If context is
provided, helpfile must also be provided.
Remarks
When both helpfile and context are supplied, a Help button is automatically added to the dialog box.
If the user clicks OK or presses ENTER, the InputBox function returns whatever is in the text box. If the user clicks Cancel, the function
returns a zero-length string ("").
The following example uses the InputBox function to display an input box and assign the string to the variable Input:
Dim Input
Input = InputBox("Enter your name")
MsgBox ("You entered: " & Input)
Requirements
Version 1
See Also
MsgBox Function
VBScript
file://C:\Documents%20and%20Settings\latham\Local%20Settings\Temp\~hh888.htm
29
© 2001 Microsoft Corporation. All rights reserved.
Build: Topic Version 5.6.9309.1546
InStr Function
Returns the position of the first occurrence of one string within another.
InStr([start, ]string1, string2[, compare])
Arguments
start
Optional. Numeric expression that sets the starting position for each search. If omitted, search begins at the first character position. If
start contains Null, an error occurs. The start argument is required if compare is specified.
string1
Required. String expression being searched.
string2
Required. String expression searched for.
compare
Optional. Numeric value indicating the kind of comparison to use when evaluating substrings. See Settings section for values. If
omitted, a binary comparison is performed.
Settings
The compare argument can have the following values:
Visual Basic Scripting Edition
Constant
Value
Description
vbBinaryCompare 0
Perform a binary comparison.
vbTextCompare
1
Perform a textual comparison.
VBScript
file://C:\Documents%20and%20Settings\latham\Local%20Settings\Temp\~hh888.htm
35
Return Values
The InStr function returns the following values:
Remarks
The following examples use InStr to search a string:
Dim SearchString, SearchChar, MyPos
SearchString ="XXpXXpXXPXXP" ' String to search in.
SearchChar = "P" ' Search for "P".
MyPos = Instr(4, SearchString, SearchChar, 1) ' A textual comparison starting at position 4. Returns 6.
MyPos = Instr(1, SearchString, SearchChar, 0) ' A binary comparison starting at position 1. Returns 9.
MyPos = Instr(SearchString, SearchChar) ' Comparison is binary by default (last argument is omitted). Returns 9.
MyPos = Instr(1, SearchString, "W") ' A binary comparison starting at position 1. Returns 0 ("W" is not found).
Note The InStrB function is used with byte data contained in a string. Instead of returning the character position of the first
occurrence of one string within another, InStrB returns the byte position.
Requirements
Version 1
See Also
InStrRev Function
If
InStr returns
string1 is zero-length
0
string1 is Null
Null
string2 is zero-length
start
string2 is Null
Null
string2 is not found
0
string2 is found within string1 Position at which match is found
start > Len(string2)
)
0
VBScript
file://C:\Documents%20and%20Settings\latham\Local%20Settings\Temp\~hh888.htm
VB.NET PDF - WPF PDF Viewer for VB.NET Program Highlight Text. Add Text. Add Text Box. Drawing Markups. PDF Print. VB.NET project, annotate PDF document with various notes and shapes, convert PDF to Word
add comments to pdf online; adding notes to pdf files
28
© 2001 Microsoft Corporation. All rights reserved.
Build: Topic Version 5.6.9309.1546
InStrRev Function
Returns the position of an occurrence of one string within another, from the end of string.
InStrRev(string1, string2[, start[, compare]])
Arguments
string1
Required. String expression being searched.
string2
Required. String expression being searched for.
start
Optional. Numeric expression that sets the starting position for each search. If omitted, -1 is used, which means that the search begins at
the last character position. If start contains Null, an error occurs.
compare
Optional. Numeric value indicating the kind of comparison to use when evaluating substrings. If omitted, a binary comparison is
performed. See Settings section for values.
Settings
The compare argument can have the following values:
Visual Basic Scripting Edition
Constant
Value
Description
vbBinaryCompare0
Perform a binary comparison.
vbTextCompare 1
Perform a textual comparison.
VBScript
file://C:\Documents%20and%20Settings\latham\Local%20Settings\Temp\~hh888.htm
33
Return Values
InStrRev returns the following values:
Remarks
The following examples use the InStrRev function to search a string:
Dim SearchString, SearchChar, MyPos
SearchString ="XXpXXpXXPXXP" ' String to search in.
SearchChar = "P" ' Search for "P".
MyPos = InstrRev(SearchString, SearchChar, 10, 0) ' A binary comparison starting at position 10. Returns 9.
MyPos = InstrRev(SearchString, SearchChar, -1, 1) ' A textual comparison starting at the last position. Returns 12.
MyPos = InstrRev(SearchString, SearchChar, 8) ' Comparison is binary by default (last argument is omitted). Returns 0.
Note The syntax for the InStrRev function is not the same as the syntax for the InStr function.
Requirements
Version 2
See Also
InStr Function
If
InStrRev returns
string1 is zero-length
0
string1 is Null
Null
string2 is zero-length
start
string2 is Null
Null
string2 is not found
0
string2 is found within string1 Position at which match is found
start > Len(string2)
)
0
VBScript
file://C:\Documents%20and%20Settings\latham\Local%20Settings\Temp\~hh888.htm
28
© 2001 Microsoft Corporation. All rights reserved.
Build: Topic Version 5.6.9309.1546
Int, Fix Functions
Returns the integer portion of a number.
Int(number)
Fix(number)
The number argument can be any valid numeric expression. If number contains Null, Null is returned.
Remarks
Both Int and Fix remove the fractional part of number and return the resulting integer value.
The difference between Int and Fix is that if number is negative, Int returns the first negative integer less than or equal to number, whereas
Fix returns the first negative integer greater than or equal to number. For example, Int converts -8.4 to -9, and Fix converts -8.4 to -8.
Fix(number) is equivalent to:
Sgn(
number
) * Int(Abs(
number
))
The following examples illustrate how the Int and Fix functions return integer portions of numbers:
MyNumber = Int(99.8) ' Returns 99.
MyNumber = Fix(99.2) ' Returns 99.
MyNumber = Int(-99.8) ' Returns -100.
MyNumber = Fix(-99.8) ' Returns -99.
MyNumber = Int(-99.2) ' Returns -100.
MyNumber = Fix(-99.2) ' Returns -99.
Requirements
Visual Basic Scripting Edition
VBScript
file://C:\Documents%20and%20Settings\latham\Local%20Settings\Temp\~hh888.htm
27
Version 1
See Also
CInt Function
| Round Function
© 2001 Microsoft Corporation. All rights reserved.
Build: Topic Version 5.6.9309.1546
IsArray Function
Returns a Boolean value indicating whether a variable is an array.
IsArray(
varname
)
The varname argument can be any variable.
Remarks
IsArray returns True if the variable is an array; otherwise, it returns False. IsArray is especially useful with variants containing arrays.
The following example uses the IsArray function to test whether
MyVariable
is an array:
Dim MyVariable
Dim MyArray(3)
MyArray(0) = "Sunday"
MyArray(1) = "Monday"
MyArray(2) = "Tuesday"
MyVariable = IsArray(MyArray) ' MyVariable contains "True".
".
Visual Basic Scripting Edition
VBScript
file://C:\Documents%20and%20Settings\latham\Local%20Settings\Temp\~hh888.htm
27
Requirements
Version 1
See Also
IsDate Function
| IsEmpty Function
| IsNull Function
| IsNumeric Function
| IsObject Function
| VarType Function
© 2001 Microsoft Corporation. All rights reserved.
Build: Topic Version 5.6.9309.1546
IsDate Function
Returns a Boolean value indicating whether an expression can be converted to a date.
IsDate(expression)
The expression argument can be any date expression or string expression recognizable as a date or time.
Remarks
IsDate returns True if the expression is a date or can be converted to a valid date; otherwise, it returns False. In Microsoft Windows, the
range of valid dates is January 1, 100 A.D. through December 31, 9999 A.D.; the ranges vary among operating systems.
The following example uses the IsDate function to determine whether an expression can be converted to a date:
Dim MyDate, YourDate, NoDate, MyCheck
MyDate = "October 19, 1962": YourDate = #10/19/62#: NoDate = "Hello"
MyCheck = IsDate(MyDate) ' Returns True.
MyCheck = IsDate(YourDate) ' Returns True.
e.
Visual Basic Scripting Edition
VBScript
file://C:\Documents%20and%20Settings\latham\Local%20Settings\Temp\~hh888.htm
26
MyCheck = IsDate(NoDate) ' Returns False.
Requirements
Version 1
See Also
CDate Function
| IsArray Function
| IsEmpty Function
| IsNull Function
| IsNumeric Function
| IsObject Function
| VarType Function
© 2001 Microsoft Corporation. All rights reserved.
Build: Topic Version 5.6.9309.1546
IsEmpty Function
Returns a Boolean value indicating whether a variable has been initialized.
IsEmpty(expression)
The expression argument can be any expression. However, because IsEmpty is used to determine if individual variables are initialized, the
expression argument is most often a single variable name.
Remarks
IsEmpty returns True if the variable is uninitialized, or is explicitly set to Empty; otherwise, it returns False. False is always returned if
expression contains more than one variable.
The following example uses the IsEmpty function to determine whether a variable has been initialized:
Dim MyVar, MyCheck
Visual Basic Scripting Edition
VBScript
file://C:\Documents%20and%20Settings\latham\Local%20Settings\Temp\~hh888.htm
27
MyCheck = IsEmpty(MyVar) ' Returns True.
MyVar = Null ' Assign Null.
MyCheck = IsEmpty(MyVar) ' Returns False.
MyVar = Empty ' Assign Empty.
MyCheck = IsEmpty(MyVar) ' Returns True.
Requirements
Version 1
See Also
IsArray Function
| IsDate Function
| IsNull Function
| IsNumeric Function
| IsObject Function
| VarType Function
© 2001 Microsoft Corporation. All rights reserved.
Build: Topic Version 5.6.9309.1546
IsNull Function
Returns a Boolean value that indicates whether an expression contains no valid data (Null).
IsNull(expression)
The expression argument can be any expression.
Remarks
IsNull returns True if expression is Null, that is, it contains no valid data; otherwise, IsNull returns False. If expression consists of more than
one variable, Null in any constituent variable causes True to be returned for the entire expression.
n.
Visual Basic Scripting Edition
VBScript
file://C:\Documents%20and%20Settings\latham\Local%20Settings\Temp\~hh888.htm
Documents you may be interested
Documents you may be interested