Call a foreign-language function: Difference between revisions

Content added Content deleted
Line 352: Line 352:


Lastly, there are at least two methods in FBSL to call machine code routines given their entry points:
Lastly, there are at least two methods in FBSL to call machine code routines given their entry points:
<pre>CALLABSOLUTE(ByteBuffer[, parm1[, parm2[, parm3[, parm4]]]]) ' ByteBuffer stores machine code bytes; works as a Sub
<pre>CALLABSOLUTE(ByteBuffer[, parm1[, parm2[, parm3[, parm4]]]]) ' ByteBuffer stores machine code bytes
FUNCALL(AddrOfEntryPoint[, parameters...]) ' works as either a Sub or Function</pre>
FUNCALL(EntryPoint[, parameters...]) ' EntryPoint stores function call address</pre>


All function calls support Integer, Quad, Single, Double and String parameters and returns. FBSL supports natively ASCIIZ strings only. Unicode strings require explicit ANSITOWIDE()/WIDETOANSI() transforms.
All function calls support Integer, Quad, Single, Double and String parameters and returns. FBSL supports natively ASCIIZ strings only. Unicode strings require explicit ANSITOWIDE()/WIDETOANSI() transforms.