RosettaCodeData/Task/Higher-order-functions/OxygenBasic/higher-order-functions.oxy
Ingy döt Net d066446780 langs a-z
2013-04-10 22:43:41 -07:00

27 lines
556 B
Text

'FUNCTION TO BE PASSED
'=====================
function f(double d,e) as double
return (d+e)*2
end function
'FUNCTION TAKING A FUNCTION AS AN ARGUMENT
'=========================================
function g(sys p) as string
declare function x(double d,e) as double at p
return x(10,11)
end function
'TEST: PASSING ADDRESS OF FUNCTION f
'===================================
'the name 'f' is combined with the prototype signature '#double#double'
'@' signifies the address of the function is being passed
print g(@f#double#double) 'result '42'