Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.basic.visual.misc > #1987

Re: Array of Classes?

From Deanna Earley <dee.earley@icode.co.uk>
Newsgroups comp.lang.basic.visual.misc
Subject Re: Array of Classes?
Date 2014-01-02 14:56 +0000
Organization Aioe.org NNTP Server
Message-ID <la3ulv$25m$1@speranza.aioe.org> (permalink)
References <105qb9pqd0gkmat9v7mj6c640tqeo7k5qn@4ax.com>

Show all headers | View raw


On 27/12/2013 05:46, bex wrote:
> Hey guys, how do I get this to work properly?
>
> Public Class classOne
> {
> 	Public Shared classOneMethodOne (0 to 10) As ClassTwo
> }
> End Class
>
> Public Class classTwo
> {
> 	Public Shared classTwoMethodOne(0 To 10) As Integer
> 	Public Shared classTwoMethodTwo(0 to 10) As Integer
> }
> End Class
>
> to have the declaration in the main form as
>
> classOnePrime (0 to 10) As classOne
>
> classOnePrime(1).classOneMethodOne(1).classTwoMethodOne(1)=7

I'm assuming the {} are your padding as that's not valid VB6 syntax and 
I believe not VB.Net.

Also note that Shared means they're not instance specific values meaning 
you can only access them via classTwo.classTwoMethodOne, instead of 
instanceOfClassTwo.classTwoMethodOne.

If you want to access them from instances of the ClassOne/Two, don't 
make them Shared.

Oh, and next time, telling us why it's not working will help, even just 
an error message.
In this case it would have been something like "Can not access static 
method via non static instance" which mostly gives away what the actual 
problem is :)

-- 
Deanna Earley (dee.earley@icode.co.uk)
iCatcher Development Team
http://www.icode.co.uk/icatcher/

iCode Systems

(Replies direct to my email address will be ignored. Please reply to the 
group.)

Back to comp.lang.basic.visual.misc | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Array of Classes? bex <bex@InDaHood.net> - 2013-12-27 05:46 +0000
  Re: Array of Classes? "Mayayana" <mayayana@invalid.nospam> - 2013-12-27 09:50 -0500
  Re: Array of Classes? Deanna Earley <dee.earley@icode.co.uk> - 2014-01-02 14:56 +0000

csiph-web