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


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

Re: Array of Classes?

Path csiph.com!usenet.pasdenom.info!aioe.org!.POSTED!not-for-mail
From Deanna Earley <dee.earley@icode.co.uk>
Newsgroups comp.lang.basic.visual.misc
Subject Re: Array of Classes?
Date Thu, 02 Jan 2014 14:56:02 +0000
Organization Aioe.org NNTP Server
Lines 47
Message-ID <la3ulv$25m$1@speranza.aioe.org> (permalink)
References <105qb9pqd0gkmat9v7mj6c640tqeo7k5qn@4ax.com>
NNTP-Posting-Host rjApkXnSOjrT83QpZ8fKqg.user.speranza.aioe.org
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding 7bit
X-Complaints-To abuse@aioe.org
User-Agent Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Thunderbird/24.2.0
X-Notice Filtered by postfilter v. 0.8.2
Xref csiph.com comp.lang.basic.visual.misc:1987

Show key headers only | 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