1 Answer - Sort by: Date | Rating
Sometimes we need a procedure that can accepts a variable number of arguments at various times during program( it means the procedure is sometimes called by passing one argument and at some later time same procedure can be called by passing two arguments etc.).
In this case we use the keyword ParamArray in definition header of the procedure that requires the variable number of arguments at various times.
We put this keyword in the parameter list that indicates that this procedure will receive a variable number of arguments.
The keyword ParamArray is preceded by the declaration of Variant array in the parameter list of that procedure.
Variant type array is used to enable the user to pass the arguments of any type.
The syntax of using this keyword ParamArray in procedure definition is given as:
Private sub myfun ( ParamArray x () as variant)
Dim y as integer
For y=LBound(x) to UBound(x)
Print x(y)
Next
End sub
Where 'myfun' is a procedure that uses ParamArray .this procedure can be called by passing various numbers of arguments as:
Call myfun (1)
Call myfun (1, 2)
Call myfun (1, 2, 3)
We can also pass the different number of arguments as well as the different types of arguments like:
Call myfun (1, "fun", 5.67)
The above call passes the three different types of arguments .
In this case we use the keyword ParamArray in definition header of the procedure that requires the variable number of arguments at various times.
We put this keyword in the parameter list that indicates that this procedure will receive a variable number of arguments.
The keyword ParamArray is preceded by the declaration of Variant array in the parameter list of that procedure.
Variant type array is used to enable the user to pass the arguments of any type.
The syntax of using this keyword ParamArray in procedure definition is given as:
Private sub myfun ( ParamArray x () as variant)
Dim y as integer
For y=LBound(x) to UBound(x)
Print x(y)
Next
End sub
Where 'myfun' is a procedure that uses ParamArray .this procedure can be called by passing various numbers of arguments as:
Call myfun (1)
Call myfun (1, 2)
Call myfun (1, 2, 3)
We can also pass the different number of arguments as well as the different types of arguments like:
Call myfun (1, "fun", 5.67)
The above call passes the three different types of arguments .
0
0
- What Is Centralized Database And Its Architecture?
- Will You Please Provide Me A Link To Free Download 'Object Oriented Programming With C++' By Balaguruswamy For Free? I Want This Book For Free As I Really Need It In Studies The Book Is Object Oriented Programming With C++ This Book Is Published By M
- What's The Disadvantage Management?
- What Particular Programming Language Did Use In Word Prediction?
- Write A C Program To Find The Sum Of 1/1+1/2+1/3+.....1/n?
- Write A C Program To Count The Number Of Days,weeks,month,year Between Two Days?
- What Does Literati-on Mean?
- What Is The Relational Model Terminology?
- What Is Abstract Class In Details?
- What Is The Difference Between Pointer Variable And Simple Variable? What Are The Advantages Of Pointer Variable
- What Seeking Independence?
- What Do You Mean By Data Security?
- Problem In SQL Connection To Remote Server?
- What Is Meant By Remote Method Invocation In Java?
- What Is Meant By Package In Java?
- What Is Meant B Cookies In Java?
- What Is Meant By Servlet In Java?
- What Is Meant By Applets?
- What Are The Classified Input In Economists?
- What Are The Classified Input Had Economics?
- Which Is Powerful Between ASP.NET & PHP?
- How Do You Program Ct 90159?
- What Is The Difference Between A Formal Programming Language And A Pseudo-code?
- What's The Function Of Database Analysts?
- How To Write A C++ Program To Find The Area Of Cirvle?

New Comment - Comments are editable for 5 min.