RosettaCodeData/Task/Classes/FreeBASIC/classes.freebasic

28 lines
534 B
Plaintext

' FB 1.05.0 Win64
Type MyClass
Private:
myInt_ As Integer
Public:
Declare Constructor(myInt_ As Integer)
Declare Property MyInt() As Integer
Declare Function Treble() As Integer
End Type
Constructor MyClass(myInt_ As Integer)
This.myInt_ = myInt_
End Constructor
Property MyClass.MyInt() As Integer
Return myInt_
End Property
Function MyClass.Treble() As Integer
Return 3 * myInt_
End Function
Dim mc As MyClass = MyClass(24)
Print mc.MyInt, mc.Treble()
Print "Press any key to quit the program"
Sleep