Joshy
Code: Select all
type tThing
declare constructor
declare constructor (byval va as integer, _
byval vb as integer, _
byval vc as integer)
as integer a=any,b=any,c=any
end type
constructor tThing
end constructor
constructor tThing (byval va as integer, _
byval vb as integer, _
byval vc as integer)
a=va : b=vb : c=vc
end constructor
type tTest
declare destructor
declare constructor
declare sub addThing(byref thig as const tThing)
as tThing things(any)
end type
destructor tTest
' does FreeBASIC frees the array things() self ?
end destructor
constructor tTest
end constructor
sub tTest . addThing(byref thing as const tThing)
redim preserve things(ubound(things)+1)
things(ubound(things))=thing
end sub
dim as tTest test
test.addThing(tThing(1,2,3))
test.addThing(tThing(4,5,6))
for i as integer = 0 to ubound(test.things)
print test.things(i).a,test.things(i).b,test.things(i).c
next
sleep