Author Topic: ScriptBasic HTML Extension Module  (Read 5042 times)

0 Members and 1 Guest are viewing this topic.

John Spikowski

  • Posts: 34
ScriptBasic HTML Extension Module
« on: November 14, 2021, 08:33:45 PM »
I've started work on a new extension module for the Business Application Server. (BAS)  The goal of the HTML extension module is to render HTML/JavaScript-AJAX/CSS page elements as extension module method calls and property settings. I'm going to use the IUP design concept for container and control rendering. This will allow desktop BASIC programmers to create browser applications with little knowledge of web programming.

I'm happy to report that the ScriptBasic COM extension module works great with the application server. You just can't instantiate any Windows UI components. (warning but obvious) It seems to work fine with BOI. Here is an example.

Code: Script BASIC
  1. ' BOI Customer Contact - Web Page
  2.  
  3. IMPORT cgi.sbi
  4. IMPORT com.sbi
  5.  
  6. cgi::Header 200,"text/html"
  7. cgi::FinishHeader
  8.  
  9. PRINT """
  10. <html>
  11. <header>
  12. <title>ScriptBasic 100 BOI</title>
  13. </header>
  14. <body>
  15. <table>
  16. <center><h1>ABC - Customer Contacts</h1></center>
  17. <table style="width:100%">
  18.  <tr>
  19.    <th>Customer Number</th>
  20.    <th>Company Name</th>
  21.    <th>Phone Number</th>
  22.  </tr>
  23. """
  24.  
  25. oscript = COM::CREATE(:SET, "ProvideX.Script")
  26. COM::CBN oScript, "Init", :CALL, "C:\\Sage\\Sage 100 Standard\\MAS90\\Home"
  27. osession = COM::CBN(oscript, "NewObject", :SET, "SY_Session")
  28. COM::CBN osession, "nSetUser", :CALL, "USER", "PASSWORD"
  29. COM::CBN osession, "nsetcompany", :CALL, "ABC"
  30. COM::CBN osession, "nSetDate", :CALL, "A/R", "20210722"
  31. COM::CBN osession, "nSetModule", :CALL, "A/R"
  32. ocust = COM::CBN(oscript, "NewObject", :SET, "AR_Customer_svc",  osession)
  33.  
  34. COM::CBN ocust,"nMoveFirst"
  35. DO UNTIL COM::CBN(ocust, "nEOF", :GET)
  36.   PRINT "  <tr>\n"
  37.   PRINT "    <td>", COM::CBN(ocust, "sARDIVISIONNO", :GET), "-", COM::CBN(ocust, "sCUSTOMERNO", :GET), "</td>\n"
  38.   PRINT "    <td>", COM::CBN(ocust, "sCUSTOMERNAME", :GET), "</td>\n"
  39.   PRINT "    <td>", COM::CBN(ocust, "sTELEPHONENO", :GET), "</td>\n"
  40.   COM::CBN ocust, "nMoveNext"
  41.   PRINT "  </tr>\n"
  42. LOOP
  43.  
  44. PRINT """
  45. </table>
  46. </body>
  47. </html>
  48. """
  49.  
  50. COM::CBN ocust, "DropObject"
  51. COM::RELEASE ocust
  52. COM::CBN osession, "DropObject"
  53. COM::RELEASE osession
  54. COM::RELEASE oscript
  55.  


Stay tuned, more to come.

John Spikowski

  • Posts: 34
Re: ScriptBasic HTML Extension Module
« Reply #1 on: November 15, 2021, 09:53:30 PM »
I found a nice JQuery and Bootstap JavaScript routine to create resizable and moveable popup forms. I plan to used this with my ScriptBasic HTML extension module to create popup modal dialogs for functions like look-ups and previews.

I really like the Bootstrap framework for building form based browser applications. The library touts mobile first as their motto.

I'm looking forward to see if I can get Sage 100 working as a browser application using BOI and eliminating NOMADS.

Example  (right click / view source) to see how it's done.

I need to add an extension to Bootstrap to allow this to work on a phone. I'll update the example soon.


« Last Edit: November 17, 2021, 12:22:25 AM by John Spikowski »

John Spikowski

  • Posts: 34
Re: ScriptBasic HTML Extension Module
« Reply #2 on: November 28, 2021, 06:04:30 AM »
I found a great open source Bootstrap theme I plan to base the NOMADS replacement on.  Check out the menu options to show the interface components. Try it on your PC and phone.

Quote
Bootstrap is the most popular HTML, CSS, and JS framework for developing responsive, mobile first projects on the web.

Bootstrap was developed and being used by Twitter.

FYI Bootstrap 5 > no longer requires jQuery as a dependency. Using one framework makes my encapsulation much easier. 

Bootstrap Spur Demo



« Last Edit: December 01, 2021, 01:09:24 AM by John Spikowski »