|
Post by Tom Mulgrew on Jan 2, 2017 6:29:57 GMT -5
I've just uploaded a new release which supports function/subroutine pointers.
You can take the address of a function/sub, assign it to a variable or pass it to another function, and of course call it. Here's a simple example:
sub Apply(fn as function(x)) dim i for i = 1 to 10 printr fn(i) next end sub
function Twice(n) return n * 2 end function
function Squared(n) return n * n end function
printr "Twice": Apply(&Twice) printr "Squared": Apply(&Squared)
|
|