Oxygen now uses the word link to pass a function pointer to a thinBasic pointer. ThinBasic uses at to map a function address to a pointer
This is the standard way of interfacing OxygenBasic procedures and thinBasic procedures.
uses "oxygen"
dim as string src
dim as long pHypot3d
dim as long pFinish
src="
function hypot3d(double a,double b, double c) as double link #pHypot3d
return sqr( a*a+b*b+c*c)
end function
sub finish() link #pFinish
terminate 'release all resources
end sub
"
o2_basic src
if o2_error then
msgbox 0,o2_error
stop
else
o2_exec
end if
declare function Hypot3d(byval double, byval double, byval double ) as double at pHypot3d
declare sub Finish() at pFinish
msgbox 0,Hypot3d(2,3,4)
Finish()
Bookmarks