?
Solved

Passing multiple parms to proc/func

Posted on 2011-10-13
5
Medium Priority
?
189 Views
Last Modified: 2012-05-12
I’ve forgotten the syntax for sending multiple parameters to a proc/func ?

For example you could call my SaveData proc in any of these ways:

SaveData(Data1, Data2)
SaveData(Data1, Data2, Data3 ……, etc …. etc, etc…..)
SaveData(Data1, Data2, Data3 ……, etc …. etc, etc….., etc …. etc, …..)


(And I don’t mean passing an array or overloading)

Cant remember the code syntact whan creating the proc/func !!!??!?
Tried googling but its one of them days … :(

Thanks in advance,
K.
0
Comment
Question by:Kinger247
  • 3
5 Comments
 
LVL 8

Expert Comment

by:VipulKadia
ID: 36961056
Hi Kinger247,
when you declare your sub/function, use 'Optional' keywork before parameter.
e.g. Public sub SaveData(Param1 as int, Optional Param2 as int, Optional Param3 as int)
       
0
 
LVL 10

Author Comment

by:Kinger247
ID: 36961119
but that means you have to specify all the parameters in your function.
There's a way of doing this withought knowing how many are being passed.
So you could pass 1 paramerter or 1000.
0
 
LVL 10

Author Comment

by:Kinger247
ID: 36961121
its kind of like specifing an array of parameters ...

0
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 2000 total points
ID: 36961579
0
 
LVL 10

Author Closing Comment

by:Kinger247
ID: 36961619
Thats it, thankyou ..
I'm really having one of those dumb days today.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Suggested Courses

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question