I cleaned up the Script BASIC EVAL function to make it more traditional.
IMPORT sbt.sbi
FUNCTION EVAL(expcode)
sb = SB_New()
SB_LoadStr(sb, "result = " & expcode)
SB_Run(sb, "")
EVAL = SB_GetVar(sb, "main::result")
SB_Destroy(sb)
END FUNCTION
PRINT EVAL("2 ^ 4"),"\n"
PRINT EVAL("(10 + 6) / 4"),"\n"
PRINT FORMAT("%.3f",EVAL("SQR(3)")),"\n"
PRINT EVAL("""\"Hello " & "World\""""),"\n"
EVAL("""0
FOR x = 1 TO 5
PRINT x,"\\n"
NEXT""")
jrs@jrs-laptop:~/sb/examples/test$ time scriba eval.sb
16
4
1.732
Hello World
1
2
3
4
5
real 0m0.009s
user 0m0.008s
sys 0m0.004s
jrs@jrs-laptop:~/sb/examples/test$