BASIC Developer & Support Resources > Scripting Languages

ScriptBasic Windows 64 Bit

(1/9) > >>

John:
That's great AIR. Nice to have a 64 bit SB on Windows again. Works here.

Do you have a 64 bit build you can share and what did you use to build it?

I took a peek at the scriba.exe you sent and I was surprised it contained exports

Does this mean I don't need libscriba.dll for the SBT extension module?


--- Code: Bash ---scriba_BuildCode, 1, 0xfcaascriba_Call, 2, 0x10ca9scriba_CallArg, 3, 0x10cf2scriba_CallArgEx, 4, 0x1168escriba_destroy, 65, 0xe3e9scriba_DestroySbArgs, 5, 0x1109cscriba_DestroySbData, 6, 0xe7bdscriba_DoLexicalAnalysis, 7, 0xf726scriba_DoSyntaxAnalysis, 8, 0xfa1ascriba_FinishStaticModules, 9, 0x123f5scriba_GetCacheFileName, 10, 0xfe00scriba_GetConfigFileName, 11, 0xec0ascriba_GetVariable, 12, 0x11deescriba_GetVariableType, 13, 0x11d39scriba_InheritBinaryProgram, 14, 0xf216scriba_InheritConfiguration, 15, 0xec48scriba_InheritExecuteObject, 16, 0xee1fscriba_InheritModuleInterface, 17, 0xedf2scriba_InitModuleInterface, 18, 0xec8dscriba_InitSbData, 19, 0xe486scriba_InitStaticModules, 20, 0x12376scriba_IsFileBinaryFormat, 21, 0xfddescriba_LoadBinaryProgram, 22, 0xf1f0scriba_LoadBinaryProgramWithOffset, 23, 0xf0e3scriba_LoadConfiguration, 24, 0xeb72scriba_LoadInternalPreprocessor, 25, 0xf313scriba_LoadProgramString, 26, 0x1045escriba_LoadSourceProgram, 27, 0x102c9scriba_LookupFunctionByName, 28, 0x11cc8scriba_LookupVariableByName, 29, 0x11cf5scriba_new, 66, 0xe250scriba_NewSbArgs, 30, 0x1111bscriba_NewSbBytes, 31, 0xe6bbscriba_NewSbData, 32, 0xe441scriba_NewSbDouble, 33, 0xe546scriba_NewSbLong, 34, 0xe501scriba_NewSbString, 35, 0xe5c9scriba_NewSbUndef, 36, 0xe591scriba_NoRun, 37, 0x10bcescriba_PurgeBuilderMemory, 38, 0xe92escriba_PurgeExecuteMemory, 39, 0xea04scriba_PurgeLexerMemory, 40, 0xe86cscriba_PurgePreprocessorMemory, 41, 0xe9a5scriba_PurgeReaderMemory, 42, 0xe809scriba_PurgeSyntaxerMemory, 43, 0xe8cfscriba_ReadSource, 44, 0xf44fscriba_ResetVariables, 45, 0x10c5ascriba_Run, 46, 0x10aa1scriba_RunExternalPreprocessor, 47, 0x10111scriba_SaveCacheFile, 49, 0x100c1scriba_SaveCCode, 48, 0x10262scriba_SaveCode, 50, 0x10235scriba_SaveECode, 51, 0x10290scriba_SetCgiFlag, 52, 0xef45scriba_SetEmbedPointer, 53, 0xf061scriba_SetEnvironment, 54, 0xf0a2scriba_SetFileName, 55, 0xead8scriba_SetProcessSbObject, 56, 0xee45scriba_SetReportFunction, 57, 0xef63scriba_SetReportPointer, 58, 0xefa1scriba_SetStdin, 59, 0xefdfscriba_SetStdout, 60, 0xf020scriba_SetVariable, 61, 0x12032scriba_ShutdownMtModules, 62, 0xeebascriba_UndefSbData, 63, 0xe4a8scriba_UseCacheFile, 64, 0xffb4 


John:
AIR,

I started a new thread for the ScriptBasic Windows 64 effort. It seems I did compile a 64 bit version of ScriptBasic which has a SBC and SBW version. I couldn't get a 64 bit cURL to compile so your contribution filled that hole. Here is a GMP example in 64 bit.

ODBC 64 bit is the next challenge.


--- Code: Script BASIC ---DECLARE SUB BI_ADD  ALIAS  "add"     LIB "gmp10"DECLARE SUB BI_SUB  ALIAS  "sub"     LIB "gmp10"DECLARE SUB BI_MUL  ALIAS  "mul"     LIB "gmp10"DECLARE SUB BI_DIV  ALIAS  "divide"  LIB "gmp10" a = "1234567890"b = "0987654321"  PRINT "ADD: ", BI_ADD(a,b),"\n"PRINT "SUB: ", BI_SUB(a,b),"\n"PRINT "MUL: ", BI_MUL(a,b),"\n"PRINT "DIV: ", BI_DIV(a,2),"\n\n" PRINT "MAXINT: ",MAXINT,"\n" 

C:\ScriptBasic\examples>sbc gmpmath.sb
ADD: 2222222211
SUB: 246913569
MUL: 1219326311126352690
DIV: 617283945

MAXINT: 2147483647

C:\ScriptBasic\examples>

John:
This is the SBT (thread extension module) example in 64 bit.


--- Code: Script BASIC ---' SBT 64 bit Demo IMPORT sbt.sbi sb_code = """FUNCTION prtvars(a, b, c)  PRINT a,"\\n"  PRINT FORMAT("%g\\n", b)  PRINT c,"\\n"  prtvars = "Function Return"END FUNCTION a = 0b = 0c = """"" sb = SB_New()SB_Configure sb, "C:/Windows/SCRIBA.INI"SB_Loadstr sb, sb_codeSB_NoRun sb' Call function before running scriptfuncrtn = SB_CallSubArgs(sb,"main::prtvars", 123, 1.23, "One, Two, Three")PRINT funcrtn,"\n"' Run script initializing globalsSB_Run sb, ""' Assign variables valuesSB_SetInt sb, "main::a", 321SB_SetDbl sb, "main::b", 32.1SB_SetStr sb, "main::c", "Three,Two,One" & CHR(0)' Call function again with variables assigned in the previous stepSB_CallSubArgs sb, "main::prtvars", _          SB_GetVar(sb, "main::a"), _          SB_GetVar(sb, "main::b"), _          SB_GetVar(sb, "main::c")SB_Destroy sb 

C:\ScriptBasic\examples>sbc sbt_demo.sb
123
1.23
One, Two, Three
Function Return
321
32.1
Three,Two,One

C:\ScriptBasic\examples>

John:
SQLite 64 bit.


--- Code: Script BASIC ---' SQLite CREATE / INSERT / SELECT IMPORT sqlite.sbi db = sqlite::open("sqlite_demo.db") sqlite::execute(db,"create table demo (someval integer, sometxt text);")sqlite::execute(db,"insert into demo values (123,'hello');")sqlite::execute(db, "INSERT INTO demo VALUES (234, 'cruel');")sqlite::execute(db, "INSERT INTO demo VALUES (345, 'world');")  stmt = sqlite::query(db,"SELECT * FROM demo") WHILE sqlite::row(stmt) = sqlite::SQLITE3_ROW  IF sqlite::fetchhash(stmt, column) THEN    PRINT column{"someval"},"\t-\t",column{"sometxt"},"\n"  END IFWEND sqlite::close(db) 

C:\ScriptBasic\examples>sbc sqlite_demo.sb
123     -       hello
234     -       cruel
345     -       world

C:\ScriptBasic\examples>

John:
Mini XML


--- Code: Script BASIC ---include mxml.sbi filename = "mxml_demo.xml" doc = mxml::LoadDoc(filename) node =  mxml::GetNode(doc,"/stufflist/stuff_test")if node then print "Test1: ", mxml::GetNodeValue(node),"\n" node =  mxml::GetNode(doc,"/stufflist/stuff_test2")if (node) then print "Test2: ", mxml::GetNodeValue(node),"\n\n"  node = mxml::GetNode(doc,"/stufflist/stuff_test3/painting/img")if node then        print "Image: ", mxml::GetProperty(node,"src"), "\n"        print "Alt Image: ", mxml::GetProperty(node,"alt"), "\n\n"endif  node = mxml::GetNode(doc,"/stufflist/books")child = mxml::GetChild(node) while child        node = mxml::GetNode(child,"id")        if node then print "ID = ", mxml::GetNodeValue(node),"\n"        node = mxml::GetNode(child,"name")        if node then print "Name = ", mxml::GetNodeValue(node),"\n"         child = mxml::GetNext(child)wend  if doc then mxml::FreeDoc(doc) 

C:\ScriptBasic\examples>sbc mxml_demo.sb
Test1: This is a test!
Image: madonna.jpg
Alt Image: Foligno Madonna, by Raphael


C:\ScriptBasic\examples>


JSON


--- Code: Script BASIC ---' SB JSON Create Entries import json.sbi root = json::New()json::SetText(root,"client1.name","Joe Blow")json::SetNum(root,"client1.age", 56)json::SetText(root,"client1.address.city","Tarrytown")json::SetText(root,"client1.address.state","NY")json::SetText(root,"client1.address.zip","10891") json::SetText(root,"client2.name","John Smith")json::SetNum(root,"client2.age",86)json::SetText(root,"client2.address.city","Cupertino")json::SetText(root,"client2.address.state","CA")json::SetText(root,"client2.address.zip","N/A")json::Save("root.json") 

--- Code: Script BASIC ---' SB READ IN CREATED JSON import json.sbi jObject = json::loadfile("root.json")for i = 0 to json::count(jObject)-1    obj = json::object(jObject,i)    print string(40,"-"),"\n"    print json::Get(obj,"name"),"\n"    print json::Get(obj,"age"),"\n"    print json::Get(obj,"address.city"),"\n"    print json::Get(obj,"address.state"),"\n"    print json::Get(obj,"address.zip"),"\n"nextprint string(40,"-"),"\n" 
root.json


--- Code: Text ---{    "client1": {        "name": "Joe Blow",        "age": 56,        "address": {            "city": "Tarrytown",            "state": "NY",            "zip": "10891"        }    },    "client2": {        "name": "John Smith",        "age": 86,        "address": {            "city": "Cupertino",            "state": "CA",            "zip": "N\/A"        }    }} 

C:\ScriptBasic\examples>sbc parse.sb
----------------------------------------
Joe Blow
56
Tarrytown
NY
10891
----------------------------------------
John Smith
86
Cupertino
CA
N/A
----------------------------------------

C:\ScriptBasic\examples>

Navigation

[0] Message Index

[#] Next page

Go to full version