Oxygen <- thinbasic -> cooperability issue
issueid=318 30-09-2011 09:54
Super Moderator
Number of reported issues by Petr Schreiber: 126
Oxygen <- thinbasic -> cooperability issue
It seems there is problem linking the procedure addresses between Oxygen and ThinBASIC

Hi,

I think this code worked fine before, but now I get zeros for both code pointers. I am not sure whether it is issue in Oxygen or ThinBASIC, but I am posting it here to not forget about it:
#MINVERSION 1.8.9.0

Uses "Oxygen"     

DWord oxySumTwo, oxyFinish
String callbackCode
callbackCode = "     
basic 

Function Oxygen_SumTwo( Byval a As Long, Byval b As Long) As Long At #oxySumTwo
  return a+b
End Function  

Sub Oxygen_Finish() At #oxyFinish 
  terminate
End Sub
     
"                                           
  
O2_BASIC callbackCode

If Len(O2_ERROR) Then
  MsgBox 0, O2_ERROR, "JIT compilation failed" 
Else  
  O2_EXEC      
  
  MsgBox 0, "oxySumTwo: " + oxySumTwo + $CRLF +
            "oxyFinish: " + oxyFinish,
            "The values should be non-zero"
End If
Petr
Issue Details
Issue Number 318
Project thinBasic
Category Unknown
Status Not a Bug
Priority 2
Affected Version 1.8.9
Fixed Version (none)
Milestone (none)
Users able to reproduce bug 0
Users unable to reproduce bug 0
Assigned Users (none)
Tags (none)




01-10-2011 09:35
thinBasic author
Petr,

I do not know really.
Calling O2_BASIC ... is supposed to fill pointer to Oxygen functions but it is not.

We have to ask to Charles.

01-10-2011 09:40
thinBasic author
Looking at Oxygen example, I think I've found the problem!

Change AT with LINK in Oxygen function like in the following way:

Function Oxygen_SumTwo( ByVal a As Long, ByVal b As Long) As Long link #oxySumTwo
Sub Oxygen_Finish() link #oxyFinish

02-10-2011 00:17
Super Moderator
That was it, thanks!
With the change the script runs ok now :)


Petr

+ Reply