classes or structs in VB
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
in VB a struct is a "user defined type" and is declared as follows:
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)
Public Type SomeStruct ID As Long Name As String X as Single Y As SingleEnd 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)
Yo, thanks for the quick responce. That is exactly what I needed. I can now continue blissfully
Embrace the id. You will never go hunger.
Embrace the id. You will never go hunger.
I believe VB.net supports ''proper'' classes. And inheritance etc ... A big leap forward me thinks
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement