Name
CallByName Function — Microsoft.VisualBasic.Interaction
Synopsis
CallByName(Object, ProcName, UseCallType, Args
( ))
Object
required; ObjectA reference to the object containing the procedure being called.
ProcName
required; StringThe name of the procedure to call.
UseCallType
required;CallType
constantA constant of type
CallType
indicating what type of procedure is being called. TheCallType
constants are:
Constant |
Value |
Description |
|
1 |
The called procedure is a method |
|
2 |
The called procedure retrieves a property value |
|
4 |
The called procedure sets the value of a property |
Args
optional; anyA ParamArray argument representing the arguments required by the procedure being called.
Named Arguments
Yes, if Args
( )
is
omitted
Return Value
Depends on the return value (if any) of the called procedure
Description
Provides a method for calling a class member by name.
Since ProcName
is a string expression,
rather than the literal name of a routine, it is possible to call
routines dynamically at runtime using a string variable to hold the
various procedure names.
Get VB.NET Language Pocket Reference now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.