473,405 Members | 2,344 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Any way to pass an optional array?

The code below gives me an error of "expression expected" at the first curly
brace. Thanks for any help.

Public Sub PopulateForm(Optional ByVal myID As Integer = -1, Optional ByVal
myRecipients() As Integer = {-1})


Jul 25 '06 #1
3 7214
it doesnt like your arguement because its expecting a declaration with the
{}, so try changing it to this

Private Sub z(Optional ByVal arr() As Integer = Nothing)
hope that helps

--
-iwdu15
Jul 25 '06 #2
Ryan wrote:
The code below gives me an error of "expression expected" at the first curly
brace. Thanks for any help.

Public Sub PopulateForm(Optional ByVal myID As Integer = -1, Optional ByVal
myRecipients() As Integer = {-1})

From the docs ('Parameter List'):

defaultvalue
Required for Optional parameters. Any constant or constant expression
that evaluates to the data type of the parameter. If the type is Object,
or a class, interface, array, or structure, the default value can only
be Nothing.

--
Larry Lard
la*******@googlemail.com
The address is real, but unread - please reply to the group
For VB and C# questions - tell us which version
Jul 25 '06 #3
That does the trick. Thanks.
"iwdu15" <jmmgoalsteratyahoodotcomwrote in message
news:59**********************************@microsof t.com...
it doesnt like your arguement because its expecting a declaration with the
{}, so try changing it to this

Private Sub z(Optional ByVal arr() As Integer = Nothing)
hope that helps

--
-iwdu15

Jul 25 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Han | last post by:
Using preg_match_all, I need to capture a list of first and last names plus an optional country code proceeding them. For example: <tr><td>AU</td><td>Jane Smith</td></tr>...
5
by: John T | last post by:
I am trying to make a function that takes an optional parameter that gets passed by reference. Here is the first line of my function definition: function funQueryDatabase($strQuery,...
1
by: mtz | last post by:
On IE there is a way to open a window from one page and pass an object to it, when you use showModalDialog. Is there a way to do the same on NS/Mozilla/FireFox? On IE:...
0
by: sebascomeau | last post by:
Hi everyone, Hello my name is Sebastien and I need some help. He have one week past and I search to do one thing but I can't. If someone help me, I'll be so happy :). My problem is I want to...
28
by: Bill | last post by:
Hello All, I am trying to pass a struct to a function. How would that best be accomplished? Thanks, Bill
3
by: Troy | last post by:
I have a dilemma where I am creating a dynamic two dimensional array and filling it with information from a .csv file. Unfortunately, later when I try to call that information back from the array...
6
by: Queez | last post by:
I've had a good look around and no-one seems to have mentioned this, which leads me to believe that I may be missing something simple. Basically, is there a way I can do the following, and if so,...
3
by: giloosh | last post by:
can i pass a hash as a function parameter. ive seen it been used before but i can't figure out how to do it. i would like to call a function like this for example ...
3
pentahari
by: pentahari | last post by:
My function is: Function test(optional ByVal arr1() as System.Array) End Function how to declare the array as optional? i know that optional variable must be constant value, but i don't...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.