-
types
types is an important part of vb programming. it is actually a user-defined datatype. i use vb6 so here's how i do it in vb6
Code:
Public Type MyBall
Radius As Integer
ColorCode As String
SpeedX as Integer
SpeedY as Integer
End Type
now that the type has been defined it can be used in the code like:
Code:
MyBall.Radius = 20
MyBall.ColorCode = "255,255,255"
MyBall.SpeedX = 15
MyBall.SpeedY = 25
do i have to explain the code?
what i did here basically is that i defined my own datatype as MyBall and defined the different parts of the datatype like Radius, ColorCode. i am using string to store ColorCode as i want to use the RGB color combo.
now in the second part of the code, i just put up the variables of the datatype MyBall.