![]() |
||
| Home | SwiftForth Archive | SwiftX Archive | |

Finally, it seems its impossible to pass double-floats to imported functions !
To pass floats, my final solution is:
create sfarr 32 sfloats allot
0 value nsf
: >parm ( nparm -- n*i )
to nsf
nsf 1+ 1 ?DO nsf i - sfloats sfarr + sf! LOOP
nsf 0 ?DO i cells sfarr + @ LOOP ;
Then...
\ import: float VectorMagnitude(float x, float y, float z);
3 IMPORT: VectorMagnitude ( x y z -- len )
\ use it as this
: VectorMagnitude \ N: ( x y z -- len ) \ S: --
3 >nparm VectorMagnitude nsf ! nsf sf@ ;
To pass double-floats, I have created a small .DLL with redefinitions to always use floats! - regretable solution!
Charles Melice
.
Received on Thu Feb 25 1999 - 08:47:56 PST
This archive was generated by hypermail 2.2.0 : Thu Nov 20 2008 - 03:04:26 PST