Passing multiple parms to proc/func

Posted on 2011-10-13
Medium Priority
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,
Question by:Kinger247
  • 3

Expert Comment

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)
LVL 10

Author Comment

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.
LVL 10

Author Comment

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

LVL 70

Accepted Solution

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

Author Closing Comment

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

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