The new version of MSVC SBT works on Linux as well. I will push the new SBT code to the repo and attach a Windows 64 bit compiled version for those that chose to download the runtime rather than build from source.
You may have noticed the
main::<function / var name> reference. If you were using modules (name spaces) then you can use the name of your module instead of
main (default name space) All names must be in lower case.
sbt_demo.sb' SBT 64 bit Linux Demo
IMPORT sbt.bas
sb_code = """
FUNCTION prtvars(a, b, c)
PRINT a,"\\n"
PRINT FORMAT("%g\\n", b)
PRINT c,"\\n"
prtvars = "Function Return"
END FUNCTION
a = 0
b = 0
c = ""
"""
sb = sbt::SB_New()
sbt::SB_Configure sb, "/etc/scriba/basic.conf"
sbt::SB_Loadstr sb, sb_code
sbt::SB_NoRun sb
' Call function before running script
funcrtn = sbt::SB_CallSubArgs(sb,"main::prtvars", 123, 1.23, "One, Two, Three")
PRINT funcrtn,"\n"
' Run script initializing globals
sbt::SB_Run sb, ""
' Assign variables values
sbt::SB_SetInt sb, "main::a", 321
sbt::SB_SetDbl sb, "main::b", 32.1
sbt::SB_SetStr sb, "main::c", "Three,Two,One" & CHR(0)
' Call function again with variables assigned in the previous step
sbt::SB_CallSubArgs sb, "main::prtvars", _
sbt::SB_GetVar(sb, "main::a"), _
sbt::SB_GetVar(sb, "main::b"), _
sbt::SB_GetVar(sb, "main::c")
sbt::SB_Destroy sb
Output
jrs@linux-dev:~/sb/examples$ scriba sbt_demo.sb
123
1.23
One, Two, Three
Function Return
321
32.1
Three,Two,One
jrs@linux-dev:~/sb/examples$