Call Statement


Call Statement

Syntax

     [Call] procedureName([argumentList]) 


procedureName (required)

The name of the subroutine being called


argumentList (optional)

A comma-delimited list of arguments to pass to the subroutine being called

Description

The Call statement passes execution control to a procedure, function, or dynamic-link library (DLL) procedure or function.

Usage at a Glance

  • Use of the Call keyword is optional.

  • argumentList, if present, must always be enclosed in parentheses.

  • If you use Call to call a function, the function's return value is discarded.

Example

     Call SomeProcedure(True, importantData)     ...later...     Public Sub SomeProcedure(ByVal silentFlag As Boolean, _           ByVal workData As Integer)        ...     End Sub 

Version Differences

  • In VB 6, calls to subroutines only included parentheses around the argument list when the Call keyword was included. In .NET, parentheses are required whenever arguments are present.

  • In VB 6, when calling an external routine defined using the Declare statement, you could override the defined method of passing an argument by specifying the ByVal or ByRef keywords before the argument in the Call statement. In .NET, you cannot change the argument-passing method from the defined setting.

See Also

CallByName Function




Visual Basic 2005(c) In a Nutshell
Visual Basic 2005 in a Nutshell (In a Nutshell (OReilly))
ISBN: 059610152X
EAN: 2147483647
Year: 2004
Pages: 712

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net