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
- Without Using Arithmetic Operator How To Add Two Values In Php?
- How To Make Your Phone Java Supported?
- Write Down The Complete Html Code To Generate A Web Page In The Following Format As Shown Below?
- What Is The Difference Between Two Tier And Three Tier Client/server Architecture?
- Describe The Problem With Two- Tier Server Dbms Architecture?
- What Is The Difference Between Two-tier And Three Tier Client Server Architecture?
- How To Make A Simple Programming?
- What Is A Structured Form?
- Compile A 1000 To1250 Word Survival Guide That Serves As A Resource Throughout Your Program?
- How Many Numbers Between 1 And 1000 Have An Odd Quantity Of Divisors?
- What Are The Service In Rmi?
- How To Do Loop Stitch For Attaching Palette's?
- Generate An Object-oriented Design For A System That Keeps Tracks Of Your CD And DVD Collection?
- What Is Local Procedural Call?
- What Are Difference Between Local And Remote Procedural Call?
- How Can I Compress Image Through Java?
- How To Enable Java Script On Windows Vista?
- How To Et Rid Of Error 1606?
- How To Enable Javascript On A Cricket Captr A200 Cell Phone With A 6.3.0.7."Openwave" Browser That I Cant Change Either,or Can I?
- How To Enable Javascript On A Cricket A200?
- How Can I Create A Online Banking Database?
- What I S Java Script?
- 1.7. What Is A Database System?
- How To Make Use-case Diagram , Class Diagram,Activity Diagram For Car Services?
- What Is Deference Between If Statement And Switch Statement?
- What Is Visual Basic?
- What Are The Advantages Of Using A Visual Basic 6.0?
- What Is An Array(visual Basic C++)?
- Can You Tell Me That What Are Various Procedure Types In Visual Basic?
- How Do I Connect Visual Basic To Oracle For Database?
- How Can I Describe A Dynamic Array In Visual Basic 6?
- How To Link Between Cad Software And Visual Basic?

New Comment - Comments are editable for 5 min.