Charles,
When I try to return a result from a O2 generated function it goes into an endless loop in the function. (Hello World! message box repeats)
John
include "dllcinc.sb"
oxy=dllfile("/sb22/modules/oxygen.dll")
o2_basic = dllproc( oxy, "o2_basic i =(c*source) " )
o2_exec = dllproc( oxy, "o2_exec i =(i call) " )
o2_error = dllproc( oxy, "o2_error c*=() " )
o2_errno = dllproc( oxy, "o2_errno i =() " )
o2_len = dllproc( oxy, "o2_len i =() " )
o2_mode = dllproc( oxy, "o2_mode (i mode) " )
dllcall o2_mode,1
' ==============================
src="""
extern
function funA(sys v) as sys
print "Hello World!"
funA = v
end function
function funB(sys v) as sys
print "Goodbye World! "
funB = v
end function
sub finish()
terminate
end sub
function link(sys n) as sys
select n
case 0 : return @finish
case 1 : return @funA
case 2 : return @funB
end select
end function
end extern
addr link
"""
' ==============================
function oxygen(src)
dllcall o2_basic,src
if (dllcall(o2_errno)<>0) then
dllprnt dllcall(o2_error)
a=0
else
a=dllcall(o2_exec,0)
end if
oxygen=a
end function
'
a=oxygen(src)
'
if (a<>0) then
'
' ==============================
'
Hello = dllproc(a,"Hello i=(i value) ", dllcald(a,1) )
Goodbye = dllproc(a,"Goodbye i=(i value) ", dllcald(a,2) )
Finish = dllproc(a,"Finish () ", dllcald(a,0) )
'
' ==============================
'
h = dllcall(hello,123)
g = dllcall(Goodbye,321)
dllcall(Finish)
print "hello return: ",h,"\n"
print "goodbye return: ",g,"\n"
dllprnt "Return code: " & a & "\n"
'
end if
dllfile
line input q