fb:porticula NoPaste
test_secure_callback.bas
Uploader: | The_Muh |
Datum/Zeit: | 15.10.2009 18:27:52 |
#include "secure_callback.bi"
'#main prog#
Type callback_type
Dim a_sub As Sub (id As Integer, msg As String)
Dim b_sub As Sub (id As Integer, msg As String)
Dim c_sub As Sub (id As Integer, msg As String)
End Type
enum callback_enum
a_sub
b_sub
c_sub
end enum
Sub show_text(id As Integer, msg As String)
For i As Integer = 1 To id
? msg
Next
End Sub
dim foobar as secure_call = sizeof(callback_type) / sizeof(sub)
foobar.set_sub(c_sub) = @show_text
foobar.set_sub(a_sub) = @show_text
foobar.call_sub->a_sub(1, "hallo welt")
foobar.call_sub->c_sub(2, "hello world")
sleep