81
What's New / Re: Script BASIC Windows 32 bit - Thread Start Options
« Last post by Support on February 20, 2017, 05:06:33 PM »You can start a SB thread in two ways. The first method gives you the option to run a script from a string and just load the script without running it.
sbt_2ways.sb
hellothread.sb
C:\ScriptBASIC\examples>scriba sbt_2ways.sb
Hello world from a thread
Hello world from a thread
C:\ScriptBASIC\examples>
sbt_2ways.sb
Code: Script BASIC
- IMPORT sbt.sbi
- ' Thread 1
- sb1 = SB_New()
- SB_Configure sb1, "C:/Windows/SCRIBA.INI"
- SB_Load sb1, "hellothread.sb"
- SB_Run sb1, ""
- ' Thread 2
- sb2 = SB_ThreadStart("hellothread.sb",undef,"C:/Windows/SCRIBA.INI")
- SB_Destroy(sb2)
- SB_Destroy(sb1)
hellothread.sb
Code: Script BASIC
- PRINT "Hello world from a thread\n"
C:\ScriptBASIC\examples>scriba sbt_2ways.sb
Hello world from a thread
Hello world from a thread
C:\ScriptBASIC\examples>