Kinger247
asked on
Passing multiple parms to proc/func
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.
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.
ASKER
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.
There's a way of doing this withought knowing how many are being passed.
So you could pass 1 paramerter or 1000.
ASKER
its kind of like specifing an array of parameters ...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thats it, thankyou ..
I'm really having one of those dumb days today.
I'm really having one of those dumb days today.
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)