[AccessD] ParamArray problem

John W. Colby jwcolby at colbyconsulting.com
Wed Mar 10 23:17:54 CST 2004


>I also seem to remember that passing objects in paramarrays is a nono you
can only pass value items (???)

Help says objects can be passed, or at least the array can be declared as
type object.

And I was using a "for each next" to iterate the array and found something
in an "empty" array.

John W. Colby
www.ColbyConsulting.com

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com]On Behalf Of
bruce_bruen at mlc.com.au
Sent: Wednesday, March 10, 2004 11:58 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] ParamArray problem






John,

What you've written it looks right, bu I must ask how do you know there is
"something" in the ParamArray?  I would not expect it to be equal to a
null, it is (I can remember which) actually a stack or heap pointer.  I
also seem to remember that passing objects in paramarrays is a nono you can
only pass value items (???) , but its been months since I've VBA'd so to
speak so I could be wrong on that.


...meanwhile back to the C#

hth
Bruce



                      "John W. Colby"
                      <jwcolby at colbyconsulting.        To:       "AccessD"
<AccessD at databaseadvisors.com>
                      com>                             cc:
                      Sent by:                         Subject:  [AccessD]
ParamArray problem
                      accessd-bounces at databasea
                      dvisors.com


                      11/03/2004 15:43
                      Please respond to Access
                      Developers discussion and
                      problem solving






I am doing an init() method of a class that looks like:

Public Sub Init(ByRef robjParent As Object, ParamArray lDepObjsArr() As
Variant)

where robjParent = a pointer to the parent class (ME)

and ParamArray lDepObjsArr() As Variant MAY BE an array of dependent object
classes but specifically at the moment isn't being passed anything.  I.e.
the calling function looks like

MyClass.Init me

I am passing in a pointer to self in the first parameter and nothing at all
for the array.

Since it is an array that can contain variable number of objects I expected
it to allow this.  However when I get inside the init() the lDepObjsArr has
something in it.  That something is NOT a class, and I can't debug.print
the
value...

What the heck is going on here?  Can I not do this (not pass anything to a
paramarray?

John W. Colby
www.ColbyConsulting.com


--
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com



--
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com






More information about the AccessD mailing list