In docs there is about structures
http://gambasdoc.org/help/cat/structdecl?v3

A structure is exactly like a class that would have only public
variables.

i made an example for usage of STRUCTURES after declaration.
i made this example because i couldn't find one in wiki and i had to
consult c++ help about usage of STRUCTURES.

So i think this makes things more easy.

Is this example correct? If it is it would be nice to add it in wiki
after declaration of struct.

--------------------
' Gambas module file

Public Struct Product
  Weight As Integer
  Price As Float
End Struct

Public apple As New Product


Public Sub Main()
  
  Dim banana As New Product
  
  apple.Price = 12.34
  apple.Weight = 23 
  
  banana.Price = 20.54
  banana.Weight = 16
  
  Print "The apple is weight:"; apple.Weight
  Print "The apple costs:"; apple.Price
  Print "The banana is weight"; banana.Weight
  Print "The banana costs:"; banana.Price
  

End
--------------------


-- 
Regards,
Demosthenes Koptsis.



------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to