Maybe related to my other posts about udt and oop ,
while studying the oop samples, I found that thinBasic\SampleScripts\OOP\VariadicArrayAndType.tbasic sample has an error code 102 "Expected equal sign for UDT full buffer assignment or an UDT element name." at line 23.
but I didn't catch the meaning of the description.
Uses "Console"
Type SubType
data As String
Function _Create(ByVal data As String)
Me.data = data
PrintL "Subtype created" In 12
End Function
Function _Destroy()
Me.data = ""
PrintL "Subtype destroyed" In 12
End Function
End Type
Type Base
s As SubType
Function _Create(ByVal data As String)
PrintL "Base created" In 10
Me.s._Create(data)
End Function
Function _Destroy()
Me.s._Destroy
PrintL "Base destroyed" In 10
End Function
End Type
PrintL f((116, 104, 105, 110, 66, 97, 115, 105, 99)) In 11
WaitKey
Function f( x(Any) As Byte) As String
Dim b As Base(Memory_Get(VarPtr(x(1)), UBound(x)))
Function = b.s.data
b._Destroy
PrintL "should print empty quotes now" & $DQ & b.s.data & $DQ In 8
PrintL
PrintL "result as follows:"
End Function
Bookmarks