Data update
This commit is contained in:
parent
0df55f9f24
commit
aec8ed51b6
1045 changed files with 18889 additions and 2777 deletions
28
Task/Polymorphic-copy/FreeBASIC/polymorphic-copy.basic
Normal file
28
Task/Polymorphic-copy/FreeBASIC/polymorphic-copy.basic
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
Type T
|
||||
method As Sub(pthis As T Ptr)
|
||||
End Type
|
||||
|
||||
Type S Extends T
|
||||
dato As Integer
|
||||
End Type
|
||||
|
||||
Sub TMethod(pthis As T Ptr)
|
||||
Print "T method"
|
||||
End Sub
|
||||
|
||||
Sub SMethod(pthis As S Ptr)
|
||||
Print "S method, dato = "; pthis->dato
|
||||
End Sub
|
||||
|
||||
Sub CallMethod(pthis As T Ptr)
|
||||
pthis->method(pthis)
|
||||
End Sub
|
||||
|
||||
Dim As T tt
|
||||
tt.method = @TMethod
|
||||
|
||||
Dim As S ss
|
||||
ss.method = @SMethod
|
||||
ss.dato = 123
|
||||
|
||||
Sleep
|
||||
Loading…
Add table
Add a link
Reference in a new issue