Jump to content
  • Advertisement


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


classes or structs in VB

This topic is 5952 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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...

--- krez (krezisback@aol.com)

Share this post

Link to post
Share on other sites
I believe VB.net supports ''proper'' classes. And inheritance etc ... A big leap forward me thinks

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!