Dim MethodLoad as BANanoObject
...
Sub CallOk(number As Int)
Log("demo " & number)
End Sub
#if JavascriptSmart
function TestFunc(_B, num){ // Make sure this JavaScript method has _B as first parameter. You can add others, like num in this example after it.
${MethodLoad}(num); // Make sure you add '(...);' after the method name! (can be without params '();'
}
#End If
' HERE STARTS YOUR APP
Sub BANano_Ready()
' define an int that we will pass to the CallOk method
Dim num As Int
' defining the definition of CallOk
MethodLoad = BANano.CallBack(Me, "CallOk", Array(num))
' somewhere in you program running TestFunc with as first parameter the class that has TestFunc (in this case Me),
' and as second parameter e.g. a number
BANano.RunJavascriptMethod("TestFunc", Array(Me,123456789))
...