Skip to content

Latest commit

 

History

History
39 lines (27 loc) · 1.72 KB

File metadata and controls

39 lines (27 loc) · 1.72 KB
description title ms.date f1_keywords helpviewer_keywords ms.assetid
Learn more about: ParamArray (Visual Basic)
ParamArray
07/20/2015
vb.ParamArray
ParamArray
ParamArray keyword [Visual Basic]
ParamArray keyword [Visual Basic], syntax
a5f18789-92bd-488f-9c7e-cf3719963635

ParamArray (Visual Basic)

Specifies that a procedure parameter takes an optional array of elements of the specified type. ParamArray can be used only on the last parameter of a parameter list.

Remarks

ParamArray allows you to pass an arbitrary number of arguments to the procedure. A ParamArray parameter is always declared using ByVal.

You can supply one or more arguments to a ParamArray parameter by passing an array of the appropriate data type, a comma-separated list of values, or nothing at all. For details, see "Calling a ParamArray" in Parameter Arrays.

Important

Whenever you deal with an array which can be indefinitely large, there is a risk of overrunning some internal capacity of your application. If you accept a parameter array from the calling code, you should test its length and take appropriate steps if it is too large for your application.

The ParamArray modifier can be used in these contexts:

Declare Statement

Function Statement

Property Statement

Sub Statement

See also