[Gambas-user] gb3: converting structures to classes

Kevin Fishburne kevinfishburne at ...1887...
Sun Feb 5 08:39:43 CET 2012


I tried to find the previous email suggesting this and couldn't, neither 
is there an equivalent wiki article describing class creation as there 
is with structure creation, so I'm asking here.

I need to know how to convert structure declarations to class 
declarations, and if there are any obvious syntactical differences in 
declaration, assignment as properties to other classes, or assigning 
actual data. I'm using structures like this:

Public Struct Client_Animation
   Animating As Boolean
   OrientationDefault As Single
   OrientationBegin As Single
   OrientationEnd As Single
   OrientationCurrent As Single
   OrientationVelocity As Single
   PositionDefaultX As Single
   PositionDefaultY As Single
   PositionBeginX As Single
   PositionBeginY As Single
   PositionEndX As Single
   PositionEndY As Single
   PositionCurrentX As Single
   PositionCurrentY As Single
   PositionVelocityX As Single
   PositionVelocityY As Single
End Struct

Public Struct Client_Gear
   Orientation As Single
   Scale As Single
   SizeCap As Short
   SizeStem As Short
   Skin As Short
   Type As Short
   Animation As Struct Client_Animation
End Struct

The logic behind the change is wanting these (numerous) structure 
declarations to be contained within their own module for organizational 
purposes and to be accessible between modules. It was suggested in 
previous emails that this was possible using classes instead of 
structures. Thanks everyone.

-- 
Kevin Fishburne
Eight Virtues
www: http://sales.eightvirtues.com
e-mail: sales at ...1887...
phone: (770) 853-6271





More information about the User mailing list