81
Problems & Solutions / Re: COM OLE
« Last post by JRS on March 18, 2021, 12:37:25 PM »I updated my firstcust.sb script to what I have installed on my Lenovo laptop.
C:\ScriptBASIC\sage>sbc firstcust.sb
Customer: ABF American Business Futures Milwaukee WI (414) 555-4787
C:\ScriptBASIC\sage>
PowerShell's Measure-Command returns TotalSeconds : 0.3442815 under ScriptBasic.
I'm working on converting this script to O2 COM/OLE.
I just noticed I wrote this original script on March 18, 2017.
Code: Script BASIC
- ' Sage BOI (Business Object Interface)- first customer - selected columns
- IMPORT COM.sbi
- oscript = COM::CREATE(:SET, "ProvideX.Script")
- COM::CBN oScript, "Init", :CALL, "C:\\Sage\\Sage 100 Standard\\MAS90\\Home"
- osession = COM::CBN(oscript, "NewObject", :SET, "SY_Session")
- COM::CBN osession, "nSetUser", :CALL, "js", "MY_PASSWORD"
- COM::CBN osession, "nsetcompany", :CALL, "ABC"
- COM::CBN osession, "nSetDate", :CALL, "A/R", "20171218"
- COM::CBN osession, "nSetModule", :CALL, "A/R"
- ocust = COM::CBN(oscript, "NewObject", :SET, "AR_Customer_svc", osession)
- COM::CBN ocust, "nMoveFirst"
- CustomerNo$ = COM::CBN(ocust, "sCustomerNo", :GET)
- CustomerName$ = COM::CBN(ocust, "sCustomerName", :GET)
- City$ = COM::CBN(ocust, "sCity", :GET)
- State$ = COM::CBN(ocust, "sState", :GET)
- TelephoneNo$ = COM::CBN(ocust, "sTelephoneNo", :GET)
- COM::CBN ocust, "DropObject"
- COM::CBN osession, "DropObject"
- COM::RELEASE oscript
- PRINT "Customer: ", CustomerNo$, " ", CustomerName$, " ", City$, " ", State$, " ", TelephoneNo$, "\n"
C:\ScriptBASIC\sage>sbc firstcust.sb
Customer: ABF American Business Futures Milwaukee WI (414) 555-4787
C:\ScriptBASIC\sage>
PowerShell's Measure-Command returns TotalSeconds : 0.3442815 under ScriptBasic.
I'm working on converting this script to O2 COM/OLE.
I just noticed I wrote this original script on March 18, 2017.