Archived

This topic is now archived and is closed to further replies.

capn_midnight

classes or structs in VB

Recommended Posts

I know classes and structs for C/C++ really well. I''m pretty sure VB has such a thing. What is it called and how do you use them? I can''t seem to find anything on it. I''m working on an asteroids clone. I just got it to where it recognizes more than one keydown at a time, and now I want to set up some classes for vectors instead of using regualar variables. AOL, so easy to use, no wonder it''s nothing but a bunch of retards Spyder''s Web Games

Share this post


Link to post
Share on other sites
in VB a struct is a "user defined type" and is declared as follows:

Public Type SomeStruct
ID As Long
Name As String
X as Single
Y As Single
End Type

a class is it''s own file, it is called a "class module", and i can''t really explain them properly without going on and on and on...
a VB class is actually a COM object (not a class as it is in c++)... they can''t be derived or anything good like that (although it allows interfaces, which are a poor substitute)... but once you get use to it they are OK...
if possible, use TYPES (structs) not classes... unlike the c++ ones they are very different, and using types is much much faster than classes...
HTH!

--- krez (krezisback@aol.com)

Share this post


Link to post
Share on other sites