Вы находитесь на странице: 1из 2

http://sharingcentre.

info

[Type the document title]


[Type the document subtitle]
ruri-69 [Pick the date]

[Type the abstract of the document here. The abstract is typically a short summary of the contents of the document. Type the abstract of the document here. The abstract is typically a short summary of the contents of the document.]

Realizat de eitan Clin

CALL STATEMENT
Transfers control to a function, sub, or dynamic-link library (dll) procedure.

[ Call ] procedurename [ (argumentlist) ]

PARTS
procedureName Required. Name of the procedure to call. argumentList Optional. List of variables or expressions representing arguments that are passed to the procedure when it is called. Multiple arguments are separated by commas. If you include argumentList, you must enclose it in parentheses.

REMARKS
You normally use the Call statement to call a procedure that does not return a value. If the procedure returns a value, the Call statement discards it. You are not required to use the Call statement when calling a procedure. However, it improves the readability of your code.

EXAMPLE
This example illustrates how the call statement is used to transfer control to a sub procedure, an intrinsic function, and a dynamic-link library (dll) procedure. ' (1) Call a Sub procedure. Call printToDebugWindow("Hello World") ...

' The above statement passes control to the following Sub procedure. Sub printToDebugWindow(ByVal anyString As String) Debug.WriteLine(anyString) End Sub

' (2) Call a Visual Basic run-time function (Shell), discard the return value. Call Shell("C:\WINNT\system32\calc.exe", AppWinStyle.NormalFocus) ' The preceding path is for Windows 2000;

' The windows xp path is c:\windows\system32\calc.exe

' (3) Call a Microsoft Windows DLL procedure. The Declare statement ' must be Private in a class, not in a module. Private Declare Sub MessageBeep Lib "User32" (ByVal N As Integer) Sub callBeepDll() Call MessageBeep(-1) End Sub

Pagina 1 din 1

Вам также может понравиться