Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!postnews.google.com!hs8g2000vbb.googlegroups.com!not-for-mail From: Peter Nolan Newsgroups: comp.lang.basic.visual.misc Subject: Re: What is a class? Date: Sat, 25 Feb 2012 03:33:11 -0800 (PST) Organization: http://groups.google.com Lines: 51 Message-ID: <7a31aab3-e442-4081-b2c6-82b475478dd9@hs8g2000vbb.googlegroups.com> References: NNTP-Posting-Host: 109.255.166.233 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1330169591 3367 127.0.0.1 (25 Feb 2012 11:33:11 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sat, 25 Feb 2012 11:33:11 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: hs8g2000vbb.googlegroups.com; posting-host=109.255.166.233; posting-account=iB8RuAoAAADKMtU8e38zXnvEqHOMbLUa User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-Header-Order: LECRUANKH X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/523.12 (KHTML, like Gecko) Version/3.0.4 Safari/523.12,gzip(gfe) X-Received-Bytes: 3132 Xref: x330-a1.tempe.blueboxinc.net comp.lang.basic.visual.misc:788 On Feb 24, 2:06=A0pm, "Auric__" wrote: > Peter Nolan wrote: > > I have tried, trust me, to learn what a class is in VB and in spite of > > many an attempt I remain baffled and I was wondering if you could help > > me out. In addition to reading I have watched YouTube videos. > > I know that fish is a class and so a trout is an instance of the class > > fish. I also know that a class contains a function and data. I better > > leave it at that because of how confused I am about the whole thing. > > Have you read the Wikipedia entry? > =A0http://en.wikipedia.org/wiki/Class_(computer_programming) > > The very first sentence there might help you: > =A0 a class is a construct that is used as a blueprint > > So, it might help to think of a class as a sort of blueprint. A class > describes something, and when you create a new instance of a class, you'r= e > using the blueprint. > > Say you're writing a game, and you have a class called "monster". When yo= u > need a new monster, you could do (for example): > =A0 Dim duck As New monster > =A0 duck.Health =3D 1 > =A0 duck.Strength =3D 1 > =A0 'etc. > ...rather than: > =A0 Dim duckHealth As Integer, duckStrength As Integer 'etc. > > -- > I'm not evil. I'm living up to my full potential! Hello Auric, I just found this YouTube video: http://www.youtube.com/watch?v=3DOuoytdFfyXs I'm sure it contains everything I need to know but I still end up confused. A dog ie this class can have a name or belong to some breed of dog. Then a new dog or an instance of that class would have a new name an say belong to another breed. Then the dog could bark or sit say and they would be functions for all dogs. I kinda get this. Do you have a very simple VB code snippet that would illustrate all that? Regards, Peter.