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


Groups > comp.lang.basic.visual.misc > #1984 > unrolled thread

Array of Classes?

Started bybex <bex@InDaHood.net>
First post2013-12-27 05:46 +0000
Last post2014-01-02 14:56 +0000
Articles 3 — 3 participants

Back to article view | Back to comp.lang.basic.visual.misc


Contents

  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

#1984 — Array of Classes?

Frombex <bex@InDaHood.net>
Date2013-12-27 05:46 +0000
SubjectArray of Classes?
Message-ID<105qb9pqd0gkmat9v7mj6c640tqeo7k5qn@4ax.com>
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



.bex

[toc] | [next] | [standalone]


#1985

From"Mayayana" <mayayana@invalid.nospam>
Date2013-12-27 09:50 -0500
Message-ID<l9k44b$sjo$1@dont-email.me>
In reply to#1984
  I'm guessing that's VB.Net. Or maybe it's something
even more far afield, given the C-style syntax? (C#?)
If VB.Net has added the annoying use of superfluous
curly braces it's news to me.
   In any case, this is a VB group. The basic explanation:

  If you are new to VB.Net, you need to know that there
are "two VBs" in use -- VB and VB.Net -- which are entirely
different beyond their similar syntax. Likewise, there are two
kinds of VB newsgroups.

  The whole situation is confusing because Microsoft dropped
".Net" from the name "VB.Net" as part of their marketing strategy
to sell .Net to VB developers.
  Adding to that confusion, VB.Net has been named with several
versioning systems. There is VB.Net v. 1, 1.1, 2, 3, 4, etc. There is
VB.Net 2003, 2005, VB.Net 2008, etc. And sometimes the VB.Net
versions are referred to as VB7, VB8, VB9, etc. even though VB.Net
is not a continuation of VB6! Officially, the first set of versions
are the framework version, the second set is the IDE version,
and the 3rd set is the language version. But in practice people
mix and match the different versions and often don't distinguish
between regular VB and VB.Net

  These days, VB5 and VB6 are VB. Anything else is probably VB.Net.

  You need to be aware of the difference between "the two VBs"
when looking for newsgroups. The same applies when searching
for sample code. VB and VB.Net code can look very similar in
some cases, but code in one system is not applicable to the other.

   The two VBs are radically different programming systems. VB is
a COM-centric system for creating compiled Windows software.
It mainly uses COM objects and the Windows API. VB.Net is
designed to be a Java competitor, similar to Java in that it is
JIT-compiled, deals almost entirely with objects, and runs on
top of a "virtual machine" -- the .Net Framework. It is optimized
for "web services" and corporate intranet programming (like Java)
rather than Windows software. VB does not use the .Net objects.
VB.Net is not directly COM compatible. The only thing in common
between the two VBs is a visual similarity in the language syntax.

  Here are some .Net groups:

microsoft.public.dotnet.general
microsoft.public.dotnet.languages.vb
microsoft.public.vsnet.general

  They may or may not be used. Microsoft discontinued their
usenet service some time ago and disowned their groups. MS
then set up a very limited number of moderated web forums,
which require membership to use and are more a marketing
venue than a discussion group. The technical topics are
greatly reduced from the usenet groups. Nonetheless, you
might want to look into the forums if you're desperate.

-- 
-
"bex" <bex@InDaHood.net> wrote in message 
news:105qb9pqd0gkmat9v7mj6c640tqeo7k5qn@4ax.com...
| 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
|
|
|
| .bex 

[toc] | [prev] | [next] | [standalone]


#1987

FromDeanna Earley <dee.earley@icode.co.uk>
Date2014-01-02 14:56 +0000
Message-ID<la3ulv$25m$1@speranza.aioe.org>
In reply to#1984
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.)

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.basic.visual.misc


csiph-web