Recent Posts

Pages: [1] 2 3 ... 10
1
Off Topic / AWS Apple Instances
« Last post by John on December 05, 2021, 04:27:44 pm »
2
Scripting Languages / Re: ScriptBasic Windows 64 Bit
« Last post by John on October 23, 2021, 02:03:26 am »
The 64 bit version of SBHTTPD for Linux runs find. It looks like this is a 64 bit Windows issue.

Here is an AJAX example working with SBHTTPD.


ScriptBasic AJAX Example

sbajax (This could have been a HTML or PHP script - I wanted to run everything on the proxy server)
Code: Script BASIC
  1. ' ScriptBasic AJAX & MySQL
  2.  
  3. IMPORT cgi.bas
  4.  
  5. cgi::Header 200,"text/html"
  6. cgi::FinishHeader
  7.  
  8. PRINT """
  9. <html>
  10. <head>
  11. <script>
  12. function showItems(str) {
  13.  if (str == "") {
  14.    document.getElementById("results").innerHTML = "";
  15.    return;
  16.  } else {
  17.    var xmlhttp = new XMLHttpRequest();
  18.    xmlhttp.onreadystatechange = function() {
  19.      if (this.readyState == 4 && this.status == 200) {
  20.        document.getElementById("results").innerHTML = this.responseText;
  21.      }
  22.    };
  23.    xmlhttp.open("GET","/home/getitems.sb?q="+str,true);
  24.    xmlhttp.send();
  25.  }
  26. }
  27. </script>
  28. </head>
  29. <body>
  30.  
  31. <form>
  32.  <select name="items" onchange="showItems(this.value)">
  33.    <option value="">Product Line</option>
  34.    <option value="Classic Cars">Classic Cars</option>
  35.    <option value="Motorcycles">Motorcycles</option>
  36.    <option value="Planes">Planes</option>
  37.    <option value="Ships">Ships</option>
  38.    <option value="Trains">Trains</option>
  39.    <option value="Trucks and Buses">Trucks and Buses</option>
  40.    <option value="Vintage Cars">Vintage Cars</option>
  41.  </select>
  42. </form>
  43. <br>
  44. <div id="results"></div>
  45.  
  46. </body>
  47. </html>
  48. """
  49.  

getitems.sb
Code: Script BASIC
  1. ' AJAX - getitems.sb
  2.  
  3. IMPORT cgi.bas
  4. IMPORT mysql.bas
  5.  
  6. cgi::Header 200,"text/html"
  7.  
  8. PRINT """
  9. <!DOCTYPE html>
  10. <html>
  11. <head>
  12. <style>
  13. table {
  14.  width: 100%;
  15.  border-collapse: collapse;
  16. }
  17.  
  18. table, td, th {
  19.  border: 1px solid black;
  20.  padding: 5px;
  21. }
  22.  
  23. th {text-align: left;}
  24. </style>
  25. </head>
  26. <body>
  27. """
  28.  
  29. product_line = cgi::GetParam("q")
  30.  
  31. dbh = mysql::RealConnect("localhost","USERID","PASSWORD","classicmodels")
  32. mysql::query(dbh,"SELECT * FROM products WHERE productLine = '" & product_line & "'")
  33.  
  34. PRINT """
  35. <table>
  36.  <tr>
  37.    <th>Product Code</th>
  38.    <th>Product Line</th>
  39.    <th>Product Vendor</th>
  40.    <th>Product Name</th>
  41.    <th>In Stock</th>
  42.    <th>Cost</th>
  43.    <th>MSRP</th>
  44.  </tr>
  45. """
  46.  
  47. WHILE mysql::FetchHash(dbh,column)
  48.   PRINT "  <tr>\n"
  49.   PRINT "    <td>", column{"productCode"}, "</td>\n"
  50.   PRINT "    <td>", column{"productLine"}, "</td>\n"
  51.   PRINT "    <td>", column{"productVendor"}, "</td>\n"
  52.   PRINT "    <td>", column{"productName"}, "</td>\n"
  53.   PRINT "    <td align=\"right\">", column{"quantityInStock"}, "</td>\n"
  54.   PRINT "    <td align=\"right\">", FORMAT("%~$###.00~",column{"buyPrice"}), "</td>\n"
  55.   PRINT "    <td align=\"right\">", FORMAT("%~$###.00~",column{"MSRP"}), "</td>\n"
  56.   PRINT "  </tr>\n"
  57. WEND
  58.  
  59. PRINT """
  60. </table>
  61. </body>
  62. </html>
  63. """
  64.  
  65. mysql::Close(dbh)
  66.  

3
Scripting Languages / Re: ScriptBasic Windows 64 Bit
« Last post by John on August 31, 2021, 12:13:28 am »
AIR,

I can't seem to get the 64 bit version SBHTTPD to connect. It seems to load fine but when I try run a script it says the server can't be found. The 32 bit version works fine.
4
Scripting Languages / Re: ScriptBasic Windows 64 Bit
« Last post by John on August 28, 2021, 05:29:50 pm »
I just tried the dyc extension module and SB said the module can't be loaded. If I remember correctly DYC uses ASM. Is this a Windows 32 bit only extension?
5
Scripting Languages / Re: cURL Windows
« Last post by John on August 28, 2021, 05:02:23 pm »
AIR,

I'm trying to compile the cURL module but don't have the work you did to create the module. Can you send me your curl extension module directory and anything else I need to build it?

Thanks!

 
6
Scripting Languages / Re: ScriptBasic Windows 64 Bit
« Last post by John on August 27, 2021, 09:29:18 pm »
Made my day. I thought COM was lost going to 64 bit. .NET is your new friend

32 and 64 bit COM Servers
7
Scripting Languages / Re: ScriptBasic Windows 64 Bit
« Last post by AIR on August 27, 2021, 09:20:12 pm »
I noticed the -lole32 reference in the Makefile. I thought COM/OLE is only supported under 32 bit.

It depends on the COM interface you're interacting with.  If a system has both 64 and 32 bit COM interfaces for a given task, 64bit Windows will try using the 64bit interface by default.  If all you have is 32 bit, it will try to use that.
8
Scripting Languages / Re: ScriptBasic Windows 64 Bit
« Last post by John on August 27, 2021, 09:01:09 pm »
I just replaced my PUI extension module folder with yours. I recompiled the module and it works.

Quote from: AIR
The static libs you get from sourceforge do NOT allow you to build a dll of any kind.  They are for static linking when creating EXE files.

Good to know. Thanks for clarifying that for me.

Code: Bash
  1. C:\sbgcc\sbw64_src\extensions\pui>mingw32-make -B -f Makefile
  2. gcc -w -D_WIN32 -m64 -c -I.\IUP-330\include -o ..\..\bin\mod\obj\pui\s_interface.o interface.c
  3. ar -r ..\..\bin\mod\lib\pui.a ..\..\bin\mod\obj\pui\s_interface.o
  4. gcc -w -D_WIN32 -m64 -c -I.\IUP-330\include -o ..\..\bin\mod\obj\pui\interface.o interface.c
  5. gcc  -shared  -s -O2 -Wl,--output-def,"..\..\bin\mod\dll\pui_imp.def",--out-implib,"..\..\bin\mod\dll\pui_imp.a",--export-all-symbols,--enable-auto-image-base  -o ..\..\bin\mod\dll\pui.dll ..\..\bin\mod\obj\pui\interface.o -L.\IUP-330 -I.\IUP-330\include     -liup -liupcontrols -liupimglib   -liupcd -lcd -lfreetype6 -lz    -lmingw32 -lws2_32 -ladvapi32 -lgdi32 -lcomctl32 -lcomdlg32 -luuid -lole32
  6.  
  7. C:\sbgcc\sbw64_src\extensions\pui>
  8.  

Dave Zimmer with his COM extension had callbacks working from his DLL so I know it can be done and I have an example to work from.

I noticed the -lole32 reference in the Makefile. I thought COM/OLE is only supported under 32 bit.
9
Scripting Languages / Re: ScriptBasic Windows 64 Bit
« Last post by AIR on August 27, 2021, 08:48:41 pm »
The static libs you get from sourceforge do NOT allow you to build a dll of any kind.  They are for static linking when creating EXE files.


10
Scripting Languages / Re: ScriptBasic Windows 64 Bit
« Last post by John on August 27, 2021, 08:10:29 pm »
That was it. I recompiled my sbc.exe and sbw.exe with your new sb64gui.o.

I'm assuming you sent in your PUI.zip everything that is needed to static link IUP? I don't need to download the static library from SourceForge?
Pages: [1] 2 3 ... 10