I was testing the VARPTR and STRPTR functions with arrays and it seems to work. I'm still looking at floating point variables. I may need to create a
PEEKD function to to deal with them. This library is still in flux as these new functions come online.
@Charles: I should be able to pass SB pointers to your O2 JIT script functions and they be valid in O2. This could save a lot of
travel time.
DECLARE SUB STRPTR ALIAS "STRPTR" LIB "cbx"
DECLARE SUB VARPTR ALIAS "VARPTR" LIB "cbx"
DECLARE SUB PEEK ALIAS "PEEK" LIB "cbx"
b[1] = "CAT"
v = STRPTR(b[1])
PRINT v,"\n"
PRINT PEEK(v,3),"\n"
b[1] = 1
v = VARPTR(b[1])
PRINT v,"\n"
PRINT PEEK(v,1),"\n"
PRINT ASC(PEEK(v,1)),"\n"
a{"one"} = "SB"
v = STRPTR(a{"one"})
PRINT v,"\n"
PRINT PEEK(v,2),"\n"
jrs@laptop:~/sb/test$ scriba peektest.sb
28895367
CAT
28845048
<
unprintable character symbol here>
1
28895401
SB
jrs@laptop:~/sb/test$
I have decided to change the module name to
SB3. The idea is that version 3 of ScriptBasic can be prototyped in an extension module and allow users to try these upcoming core features of the next release. I think this will allow others to contribute to the project easier and learn the SB API. (
macro mania - actual product using the name)