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


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:

Uses "Oxygen"     

DWord oxySumTwo, oxyFinish
String callbackCode
callbackCode = "     

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 
End Sub
O2_BASIC callbackCode

If Len(O2_ERROR) Then
  MsgBox 0, O2_ERROR, "JIT compilation failed" 
  MsgBox 0, "oxySumTwo: " + oxySumTwo + $CRLF +
            "oxyFinish: " + oxyFinish,
            "The values should be non-zero"
End If
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

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 :)


+ Reply