fb:porticula NoPaste
Sannajs Vorschlag für einen Zeiger auf eine Methode
Uploader: | Sannaj |
Datum/Zeit: | 21.01.2012 21:53:56 |
type foo
a as integer
declare sub print_a()
declare static sub say_hello()
end type
sub foo.print_a()
print this
end sub
sub foo.say_hello()
print "Hello World"
end sub
' SyntaxVorschlag A
dim aprintPtr as sub(me as foo) = @foo.print_a()
dim helloPtr as sub() = @foo.say_hello()
dim as foo testbar
testbar.a = 10
aprintPtr(testbar)
' SyntaxVorschlag B
dim aprintPtr as sub foo.() = @foo.print_a()
dim helloPtr as sub() = @foo.say_hello()
dim as foo testbar
testbar.a = 10
testbar.aprintPtr()