1 / 57
文档名称:

Mastering Visual Basic .NET VB NET Functions (VBL).pdf

格式:pdf   页数:57
下载后只包含 1 个 PDF 格式的文档,没有任何的图纸或源代码,查看文件列表

如果您已付费下载过本站文档,您可以点这里二次下载

Mastering Visual Basic .NET VB NET Functions (VBL).pdf

上传人:mkt365 2013/11/20 文件大小:0 KB

下载得到文件列表

Mastering Visual Basic .NET VB NET Functions (VBL).pdf

文档介绍

文档介绍:Bonus Reference
Functions and
Statements
This bonus reference describes the functions and statements that are supported by Visual
Basic .NET, grouped by category. When you’re searching for the statement to open a file, you
probably want to locate all file I/mands in one place. This is exactly how this reference is
organized. Moreover, by grouping all related functions and statements in one place, I can present
examples bine more than one function or statement.
The majority of the functions are the same as in VB6. One difference is that many of the VB6
statements are implemented as functions in . Moreover, many VB6 functions have an
equivalent method in a Framework class. VB programmers are so accustomed to the old func-
tions that they will not consider the alternatives—at least for a while. The Len() function of VB6
returns the length of a string. In you can retrieve the length of a string with the Length
method of a string variable. If strVar is declared as string variable, you can retrieve its length by
calling the Length method:
Dim strVar As String = “a short string”
(“The string contains “& & “ characters”)
Or you can call the Len() function passing the name of the string as argument:
Dim strVar As String = “a short string”
(“The string contains “& Len(strVar) & “ characters”)
Most of the built-in functions are VB6 functions, and they accept optional arguments.
uses overloaded forms of the same function, and this is an important difference you
have to keep in mind as you work with the built-in functions. If you omit an optional argument,
you must still insert ma to indicate that an argument is missing. Optional arguments are
enclosed in square brackets. The Mid() function, for example, extracts a number of characters
from a string, and its syntax is
newString = Mid(string[, start][, length])
The starting location of the characters to be extracted is specified by the start arg