Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Support

Pages: 1 ... 5 6 [7] 8 9 ... 12
91
General Discussions / MTSB
« on: December 29, 2010, 12:02:57 PM »
ScriptBasic provides in it's distribution a variation of the language called sbhttpd. This example use of ScriptBasic shows how to assemble a multi-threaded webserver with in-memory session support and running as a service/daemon. I have used the sbhttpd server as a proxy behind Apache for years for my web based applications. I thought I would expand on the concept and include desktop applications to the CGI client/server realm. This concept can be used with any server side scripting language and a client with cURL like functionality.

The following posts were from the All Basic site I'm migrating here.

92
GTK-Server / IDLL
« on: December 05, 2010, 02:42:22 PM »
GTK-Server is a flexible, easy to use, scriptable interface to dynamic link libraries via a DynaCall or FFI link. Peter van Eerten (author) has created an extensive library of Gtk based library definitions, macros and a function wrapper library he calls HUG. You can interface with GTK-Server with just about any scripting language, interpreter or compiler using a DLL, TCP/UDP, FIFO or named pipes connection. The following examples demonstrate dynamic scripting of libraries and low level resource with GTK-Server and providing real time API syntax checking against it's definitions. Feel free to use any of the following API definition as a start in the language of your choice.




I have registered the IDLL.INFO domain as a repository for interpreted dynamic link library definitions that could be used by any language using the GTK-Server interface.

Code: Text
  1. DECLARE SUB DLL ALIAS "_gtk" LIB "gtk-server"
  2.  
  3. DLL("gtk_server_require libcurses.so")
  4.  
  5. DLL("gtk_server_define initscr NONE LONG 0")
  6. DLL("gtk_server_define move NONE INT 2 INT INT")
  7. DLL("gtk_server_define addstr NONE INT 1 STRING")
  8. DLL("gtk_server_define start_color NONE INT 0")
  9. DLL("gtk_server_define init_pair NONE INT 3 INT INT INT")
  10. DLL("gtk_server_define color_set NONE INT 2 INT NULL")
  11. DLL("gtk_server_define getch NONE INT 0")
  12. DLL("gtk_server_define endwin NONE INT 0")
  13.  
  14. DLL("initscr")
  15. DLL("move 0 25")
  16. DLL("addstr \"ScriptBasic Console Color Test\"")
  17. DLL("start_color")
  18. display_line = 1
  19. FOR color = 0 to 255
  20.   DLL("init_pair " & color & " " & 256 - color & " " & color)
  21.   DLL("color_set " & color)  
  22.   IF color % 16 = 0 THEN
  23.     display_line += 1
  24.     DLL("move " & display_line & " 3")
  25.   END IF
  26.   DLL("addstr \"" & FORMAT("%~ 000 ~", color) & "\"")
  27. NEXT
  28. DLL("move 22 0")
  29. DLL("getch")
  30. DLL("endwin")
  31.  




Code: Text
  1. ' SQLite3 Demo Script
  2.  
  3. DECLARE SUB DLL ALIAS "_gtk" LIB "gtk-server"
  4. DECLARE SUB VARPTR ALIAS "varptr" LIB "gtk-server"
  5.  
  6. DLL("gtk_server_require libsqlite3.so")
  7.  
  8. DLL("gtk_server_define sqlite3_open NONE INT 2 STRING LONG")
  9. DLL("gtk_server_define sqlite3_exec NONE INT 5 LONG STRING INT NULL PTR_STRING")
  10. DLL("gtk_server_define sqlite3_prepare_v2 NONE INT 5 LONG STRING INT PTR_LONG NULL")
  11. DLL("gtk_server_define sqlite3_step NONE INT 1 LONG")
  12. DLL("gtk_server_define sqlite3_column_text NONE STRING 2 LONG INT")
  13. DLL("gtk_server_define sqlite3_close NONE INT 1 LONG")
  14.  
  15. CONST SQLITE_ROW = 100
  16. db = 0
  17. dberr = 0
  18. stmt = 0
  19.  
  20. DLL("sqlite3_open \"testsql\" " & VARPTR(db))
  21. DLL("sqlite3_exec " & db & " \"CREATE TABLE demo(someval INTEGER,  sometxt TEXT);\" 0 0 " & VARPTR(dberr))
  22. DLL("sqlite3_exec " & db & " \"INSERT INTO demo VALUES (123, 'Hello');\" 0 0 " & VARPTR(dberr))
  23. DLL("sqlite3_exec " & db & " \"INSERT INTO demo VALUES (234, 'cruel');\" 0 0 " & VARPTR(dberr))
  24. DLL("sqlite3_exec " & db & " \"INSERT INTO demo VALUES (345, 'world');\" 0 0 " & VARPTR(dberr))
  25. result = DLL("sqlite3_prepare_v2 " & db & " \"SELECT * FROM demo;\" -1 " & VARPTR(stmt) & " 0")
  26. SPLIT result BY " " TO ok, stmt
  27.  
  28. WHILE DLL("sqlite3_step " & stmt) = SQLITE_ROW
  29.   PRINT DLL("sqlite3_column_text " & stmt & " " & 0) & " - " & DLL("sqlite3_column_text " & stmt & " " & 1),"\n"
  30. WEND
  31.  
  32. DLL("sqlite3_close " & db)
  33.  

Results:

jrs@Laptop:~/SB/test$ scriba sqlite3.sb
123 - Hello
234 - cruel
345 - world
jrs@Laptop:~/SB/test$

93
Download / Ubuntu 10.10 ScriptBasic runtime
« on: October 30, 2010, 07:46:13 PM »
Here is a beta ScriptBasic Ubuntu 10.10 tar.z file. Extract this in your / (root) directory to place the files in the correct directory structure. (see directory list)

Code: [Select]
etc/
etc/init.d/
etc/init.d/sbhttpd
etc/scriba/
etc/scriba/basic.conf
usr/
usr/bin/
usr/bin/sbhttpd
usr/bin/scriba
usr/share/
usr/share/scriba/
usr/share/scriba/include/
usr/share/scriba/include/time.bas
usr/share/scriba/include/error.bas
usr/share/scriba/include/modinst.bas
usr/share/scriba/source/
usr/share/scriba/source/heber.bas
usr/local/
usr/local/lib/
usr/local/lib/zlib.a
usr/local/lib/ux.a
usr/local/lib/cgi.a
usr/local/lib/sdbg.a
usr/local/lib/gd.a
usr/local/lib/xml.a
usr/local/lib/dbg.a
usr/local/lib/lscriba.a
usr/local/lib/mysql.a
usr/local/lib/mt.a
usr/local/lib/t.a
usr/local/lib/trial.a
usr/local/lib/libscriba.a
usr/local/lib/curl.a
usr/local/lib/hash.a
usr/local/lib/odbc.a
usr/local/lib/re.a
usr/local/lib/scriba/
usr/local/lib/scriba/odbc.so
usr/local/lib/scriba/xml.so
usr/local/lib/scriba/curses.so
usr/local/lib/scriba/re.so
usr/local/lib/scriba/mysql.so
usr/local/lib/scriba/dbg.so
usr/local/lib/scriba/t.so
usr/local/lib/scriba/hash.so
usr/local/lib/scriba/mt.so
usr/local/lib/scriba/sdbg.so
usr/local/lib/scriba/cgi.so
usr/local/lib/scriba/curl.so
usr/local/lib/scriba/trial.so
usr/local/lib/scriba/zlib.so
usr/local/lib/scriba/ux.so
usr/local/lib/curses.a
var/
var/cache/
var/cache/scriba/
var/cache/scriba/hebtemp/
var/cache/scriba/cache/
var/log/
var/log/scriba/

You will need to install the MySQL client, cURL binaries and iODBC client. Everything else should be static linked.

94
GTK-Server / Address Book Revisited
« on: August 28, 2010, 10:01:22 PM »
I wanted to test the Gtk-Server and MySQL extensions modules under ScriptBasic 3.0 for Window 32 and decided to dig up the old Address Book code challenge that was done on the AllBasic .INFO site.



Code: [Select]
' All Basic address book challenge - 9/15/2008
'
' Basic Language: ScriptBasic 2.1 (Windows / Linux)
'
' Authors: Peter van Eerten - www.gtk-server.org
'          John Spikowski - www.scriptbasic.org

' GTK-server extension module
INCLUDE gtk.bas
gtk_server_cfg("-cfg=C:\\GTK-server\\gtk-server.cfg")

' MySQL extension module
INCLUDE mysql.bas

' Connect to MySQL database
dbh = mysql::RealConnect("localhost","user","password","test_db")

SUB Fill_Data

' clear the list
gtk_list_store_clear(List_Store)

mysql::query(dbh,"SELECT * FROM address_book")

WHILE mysql::FetchHash(dbh, abrow)

gtk_list_store_append(List_Store, List_Iter)
gtk_list_store_set(List_Store, List_Iter, 0, abrow{"ID"}, -1)
gtk_list_store_set(List_Store, List_Iter, 1, abrow{"Name"}, -1)
gtk_list_store_set(List_Store, List_Iter, 2, abrow{"Address"}, -1)
gtk_list_store_set(List_Store, List_Iter, 3, abrow{"City"}, -1)
gtk_list_store_set(List_Store, List_Iter, 4, abrow{"State"}, -1)
gtk_list_store_set(List_Store, List_Iter, 5, abrow{"ZIP"}, -1)
gtk_list_store_set(List_Store, List_Iter, 6, abrow{"Phone"}, -1)

WEND

END SUB


SUB Add_Edit_Data

' determine which mode we are
IF Add_Edit_Mode = 1 THEN
    gtk_list_store_append(List_Store, List_Iter)
END IF

' Get the etries, currently no checking
info[0] = gtk_entry_get_text(EntryID)
info[1] = gtk_entry_get_text(EntryName)
info[2] = gtk_entry_get_text(EntryAddress)
info[3] = gtk_entry_get_text(EntryCity)
info[4] = gtk_entry_get_text(EntryState)
info[5] = gtk_entry_get_text(EntryZip)
info[6] = gtk_entry_get_text(EntryPhone)

' Add mode, store the info into the list widget
FOR i = 0 TO 6
    gtk_list_store_set(List_Store, List_Iter, i, info[i], -1)
NEXT i

' Delete the entries
gtk_editable_delete_text(EntryID, 0, -1)
gtk_editable_delete_text(EntryName, 0, -1)
gtk_editable_delete_text(EntryAddress, 0, -1)
gtk_editable_delete_text(EntryCity, 0, -1)
gtk_editable_delete_text(EntryState, 0, -1)
gtk_editable_delete_text(EntryZip, 0, -1)
gtk_editable_delete_text(EntryPhone, 0, -1)

' Edit mode? Hide dialog
IF Add_Edit_Mode = 2 THEN
    gtk_widget_hide(Entry_Field)
    SQL = "UPDATE address_book SET ID = " & info[0] & ", Name = '" & info[1] & "', Address = '" & info[2] & "', City = '" & info[3] & "', State = '" & info[4] & "', ZIP = '" & info[5] & "', Phone = '" & info[6] & "'"
ELSE
    SQL = "INSERT INTO address_book (ID, Name, Address, City, State, ZIP, Phone) VALUES (" & info[0] & ", '" & info[1] & "', '" & info[2] & "', '" & info[3] & "', '" & info[4] & "', '" & info[5] & "', '" & info[6] & "')"  
END IF

mysql::query(dbh, SQL)

END SUB


SUB Del_Data

' Check if a row is selected
IF gtk_tree_selection_get_selected(Tree_Sel, "NULL", List_Iter) = "1" THEN
    gtk_list_store_remove(List_Store, List_Iter)
    SQL = "DELETE FROM address_book WHERE ID = " & info[0]
    mysql::query(dbh, SQL)
ELSE
    gtk_widget_show_all(Error_Msg)
END IF

END SUB

' MAIN program

' Optionally enable GTK logging
' gtk_server_cfg("-log=log.txt")

' Get GLADE definition
xml = glade_xml_new("form.glade")
glade_xml_signal_autoconnect(xml)

' Get main window ID and connect signal
Main_Window = glade_xml_get_widget(xml, "Main_Window")
gtk_server_connect(Main_Window, "delete-event", "Main_Window")

' Get button IDs and connect signals
Add_Button = glade_xml_get_widget(xml, "Add_Button")
gtk_server_connect(Add_Button, "clicked", "Add_Button")
Del_Button = glade_xml_get_widget(xml, "Del_Button")
gtk_server_connect(Del_Button, "clicked", "Del_Button")
Edit_Button = glade_xml_get_widget(xml, "Edit_Button")
gtk_server_connect(Edit_Button, "clicked", "Edit_Button")
Exit_Button = glade_xml_get_widget(xml, "Exit_Button")
gtk_server_connect(Exit_Button, "clicked", "Exit_Button")

' Get scrolled window
Scrolled_Window =  glade_xml_get_widget(xml, "Scrolled_Window")

' Define the list
List_Iter = gtk_server_opaque()
GTK::gtk("gtk_server_redefine gtk_list_store_new NONE WIDGET 8 INT INT INT INT INT INT INT INT")
List_Store = GTK::gtk("gtk_list_store_new 7 64 64 64 64 64 64 64")
List_Choice = gtk_tree_view_new_with_model(List_Store)
GTK::gtk("gtk_server_connect " & List_Choice & " button-press-event " & List_Choice & " 1")
gtk_tree_view_set_headers_visible(List_Choice, 1)
gtk_tree_view_set_headers_clickable(List_Choice, 1)
gtk_tree_view_set_grid_lines(List_Choice, 3)
gtk_tree_sortable_set_sort_column_id(List_Store, 0, 0)
Tree_Sel = gtk_tree_view_get_selection(List_Choice)
gtk_tree_selection_set_mode(Tree_Sel, 2)
Txt_Cell = gtk_cell_renderer_text_new()
List_Column0 = gtk_tree_view_column_new_with_attributes("ID", Txt_Cell, "text", 0, "NULL")
gtk_tree_view_append_column(List_Choice, List_Column0)
gtk_tree_view_column_set_resizable(List_Column0, 1)
gtk_tree_view_column_set_clickable(List_Column0, 1)
List_Column1 = gtk_tree_view_column_new_with_attributes("Name", Txt_Cell, "text", 1, "NULL")
gtk_tree_view_append_column(List_Choice, List_Column1)
gtk_tree_view_column_set_resizable(List_Column1, 1)
List_Column2 = gtk_tree_view_column_new_with_attributes("Address", Txt_Cell, "text", 2, "NULL")
gtk_tree_view_append_column(List_Choice, List_Column2)
gtk_tree_view_column_set_resizable(List_Column2, 1)
List_Column3 = gtk_tree_view_column_new_with_attributes("City", Txt_Cell, "text", 3, "NULL")
gtk_tree_view_append_column(List_Choice, List_Column3)
gtk_tree_view_column_set_resizable(List_Column3, 1)
List_Column4 = gtk_tree_view_column_new_with_attributes("State", Txt_Cell, "text", 4, "NULL")
gtk_tree_view_append_column(List_Choice, List_Column4)
gtk_tree_view_column_set_resizable(List_Column4, 1)
List_Column5 = gtk_tree_view_column_new_with_attributes("ZIP", Txt_Cell, "text", 5, "NULL")
gtk_tree_view_append_column(List_Choice, List_Column5)
gtk_tree_view_column_set_resizable(List_Column5, 1)
List_Column6 = gtk_tree_view_column_new_with_attributes("Phone", Txt_Cell, "text", 6, "NULL")
gtk_tree_view_append_column(List_Choice, List_Column6)
gtk_tree_view_column_set_resizable(List_Column6, 1)
gtk_container_add(Scrolled_Window, List_Choice)
gtk_widget_show_all(Scrolled_Window)

' Add entry window
Entry_Field = glade_xml_get_widget(xml, "Entry_Field")
gtk_server_connect(Entry_Field, "delete-event", "Entry_Field")

' Get button ID and connect signal
Entry_Ok_Button = glade_xml_get_widget(xml, "Entry_Ok_Button")
gtk_server_connect(Entry_Ok_Button, "clicked", "Entry_Ok_Button")
Entry_Can_Button = glade_xml_get_widget(xml, "Entry_Can_Button")
gtk_server_connect(Entry_Can_Button, "clicked", "Entry_Can_Button")

' Get ID's for the textentries
EntryID = glade_xml_get_widget(xml, "EntryID")
EntryName = glade_xml_get_widget(xml, "EntryName")
EntryAddress = glade_xml_get_widget(xml, "EntryAddress")
EntryCity = glade_xml_get_widget(xml, "EntryCity")
EntryState = glade_xml_get_widget(xml, "EntryState")
EntryZip = glade_xml_get_widget(xml, "EntryZip")
EntryPhone = glade_xml_get_widget(xml, "EntryPhone")

' Warning dialog, define here because of a bug in Glade
Warning_Msg = gtk_message_dialog_new(Main_Window, 1, 1, 4, "\nAre you sure to delete this entry?", "''")
gtk_window_set_title(Warning_Msg, "Warning")
gtk_server_connect(Warning_Msg, "delete-event", "Warning_Msg")
gtk_server_connect(Warning_Msg, "response", "Warning_Msg_Response")

' Warning dialog, define here because of a bug in Glade
Error_Msg = gtk_message_dialog_new(Main_Window, 1, 3, 2, "\nSelect an entry first!", "''")
gtk_window_set_title(Error_Msg, "Error!")
gtk_server_connect(Error_Msg, "delete-event", "Error_Msg")

' Fill grid with data
CALL Fill_Data()

' Set sort flag
Sort_Flag = 0

' Set edit or add mode - 1=ADD, 2=EDIT
Add_Edit_Mode = 1

' Mainloop starts here
REPEAT

    ' Get event
    event = gtk_server_callback("wait")

    ' Add entry form
    IF event = "Add_Button" THEN
Add_Edit_Mode = 1
gtk_window_set_title(Entry_Field, "Add entry")
gtk_widget_show_all(Entry_Field)
gtk_widget_grab_focus(EntryID)
    END IF

    ' Edit entry form
    IF event = "Edit_Button" THEN
Add_Edit_Mode = 2
IF gtk_tree_selection_get_selected(Tree_Sel, "NULL", List_Iter) = "0" THEN
   gtk_widget_show_all(Error_Msg)
ELSE
   FOR i = 0 TO 6
info[i] = gtk_tree_model_get(List_Store, List_Iter, i, "''", -1)
   NEXT i

   ' Get the etries, currently no checking
   gtk_entry_set_text(EntryID, MID(info[0], 4))
   gtk_entry_set_text(EntryName, MID(info[1], 4))
   gtk_entry_set_text(EntryAddress, MID(info[2], 4))
   gtk_entry_set_text(EntryCity, MID(info[3], 4))
   gtk_entry_set_text(EntryState, MID(info[4], 4))
   gtk_entry_set_text(EntryZip, MID(info[5], 4))
   gtk_entry_set_text(EntryPhone, MID(info[6], 4))

   gtk_window_set_title(Entry_Field, "Edit entry")
   gtk_widget_show_all(Entry_Field)
   gtk_widget_grab_focus(EntryID)

END IF
    END IF

    ' These are the buttons on the entry form
    IF event = "Entry_Can_Button" OR event = "Entry_Field" THEN
gtk_widget_hide(Entry_Field)

' Delete the entries
gtk_editable_delete_text(EntryID, 0, -1)
gtk_editable_delete_text(EntryName, 0, -1)
gtk_editable_delete_text(EntryAddress, 0, -1)
gtk_editable_delete_text(EntryCity, 0, -1)
gtk_editable_delete_text(EntryState, 0, -1)
gtk_editable_delete_text(EntryZip, 0, -1)
gtk_editable_delete_text(EntryPhone, 0, -1)
    END IF
    IF event = "Entry_Ok_Button" THEN
CALL Add_Edit_Data()
    END IF

    ' Warning dialog
    IF event = "Del_Button" THEN
IF gtk_tree_selection_get_selected(Tree_Sel, "NULL", List_Iter) = "0" THEN
   gtk_widget_show_all(Error_Msg)
ELSE
   gtk_widget_show_all(Warning_Msg)
END IF
    END IF
    IF event = "Warning_Msg" THEN gtk_widget_hide(Warning_Msg)
    IF event = "Warning_Msg_Response" THEN
response = gtk_server_callback_value(1, "INT")
IF response = -8 THEN CALL Del_Data()
gtk_widget_hide(Warning_Msg)
    END IF

    ' Error dialog
    IF event = "Error_Msg" OR event = Error_Msg THEN gtk_widget_hide(Error_Msg)

    ' Sortable on key
    IF event = List_Column0 THEN
Sort_Flag = 1 - Sort_Flag
gtk_tree_sortable_set_sort_column_id(List_Store, 0, Sort_Flag)
    END IF

UNTIL event = "Main_Window" OR event = "Exit_Button"

' Cleanup resources
gtk_server_exit()

Glade XML project file

Code: [Select]
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
<!--Generated with glade3 3.4.4 on Sun Aug 31 20:12:55 2008 -->
<glade-interface>
  <widget class="GtkWindow" id="Entry_Field">
    <property name="title" translatable="yes">Entry</property>
    <property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
    <property name="destroy_with_parent">True</property>
    <property name="icon">supertux.xpm</property>
    <property name="transient_for">Main_Window</property>
    <child>
      <widget class="GtkVBox" id="vbox1">
        <property name="visible">True</property>
        <child>
          <placeholder/>
        </child>
        <child>
          <widget class="GtkHBox" id="hbox1">
            <property name="visible">True</property>
            <property name="border_width">3</property>
            <child>
              <widget class="GtkLabel" id="LabelId">
                <property name="width_request">100</property>
                <property name="visible">True</property>
                <property name="xalign">1</property>
                <property name="label" translatable="yes">ID: </property>
              </widget>
              <packing>
                <property name="expand">False</property>
              </packing>
            </child>
            <child>
              <widget class="GtkEntry" id="EntryID">
                <property name="visible">True</property>
                <property name="can_focus">True</property>
              </widget>
              <packing>
                <property name="position">1</property>
              </packing>
            </child>
            <child>
              <placeholder/>
            </child>
          </widget>
          <packing>
            <property name="padding">1</property>
            <property name="position">1</property>
          </packing>
        </child>
        <child>
          <widget class="GtkHBox" id="hbox2">
            <property name="visible">True</property>
            <property name="border_width">3</property>
            <child>
              <widget class="GtkLabel" id="labelNAME">
                <property name="width_request">100</property>
                <property name="visible">True</property>
                <property name="xalign">1</property>
                <property name="label" translatable="yes">Name: </property>
              </widget>
              <packing>
                <property name="expand">False</property>
              </packing>
            </child>
            <child>
              <widget class="GtkEntry" id="EntryName">
                <property name="visible">True</property>
                <property name="can_focus">True</property>
              </widget>
              <packing>
                <property name="position">1</property>
              </packing>
            </child>
            <child>
              <placeholder/>
            </child>
          </widget>
          <packing>
            <property name="padding">1</property>
            <property name="position">2</property>
          </packing>
        </child>
        <child>
          <widget class="GtkHBox" id="hbox3">
            <property name="visible">True</property>
            <property name="border_width">3</property>
            <child>
              <widget class="GtkLabel" id="label1">
                <property name="width_request">100</property>
                <property name="visible">True</property>
                <property name="xalign">1</property>
                <property name="label" translatable="yes">Address: </property>
              </widget>
              <packing>
                <property name="expand">False</property>
              </packing>
            </child>
            <child>
              <widget class="GtkEntry" id="EntryAddress">
                <property name="visible">True</property>
                <property name="can_focus">True</property>
              </widget>
              <packing>
                <property name="position">1</property>
              </packing>
            </child>
            <child>
              <placeholder/>
            </child>
          </widget>
          <packing>
            <property name="padding">1</property>
            <property name="position">3</property>
          </packing>
        </child>
        <child>
          <widget class="GtkHBox" id="hbox4">
            <property name="visible">True</property>
            <property name="border_width">3</property>
            <child>
              <widget class="GtkLabel" id="label2">
                <property name="width_request">100</property>
                <property name="visible">True</property>
                <property name="xalign">1</property>
                <property name="label" translatable="yes">City: </property>
              </widget>
              <packing>
                <property name="expand">False</property>
              </packing>
            </child>
            <child>
              <widget class="GtkEntry" id="EntryCity">
                <property name="visible">True</property>
                <property name="can_focus">True</property>
              </widget>
              <packing>
                <property name="position">1</property>
              </packing>
            </child>
            <child>
              <placeholder/>
            </child>
          </widget>
          <packing>
            <property name="padding">1</property>
            <property name="position">4</property>
          </packing>
        </child>
        <child>
          <widget class="GtkHBox" id="hbox5">
            <property name="visible">True</property>
            <property name="border_width">3</property>
            <child>
              <widget class="GtkLabel" id="label3">
                <property name="width_request">100</property>
                <property name="visible">True</property>
                <property name="xalign">1</property>
                <property name="label" translatable="yes">State: </property>
              </widget>
              <packing>
                <property name="expand">False</property>
              </packing>
            </child>
            <child>
              <widget class="GtkEntry" id="EntryState">
                <property name="visible">True</property>
                <property name="can_focus">True</property>
              </widget>
              <packing>
                <property name="position">1</property>
              </packing>
            </child>
            <child>
              <placeholder/>
            </child>
          </widget>
          <packing>
            <property name="padding">1</property>
            <property name="position">5</property>
          </packing>
        </child>
        <child>
          <widget class="GtkHBox" id="hbox6">
            <property name="visible">True</property>
            <property name="border_width">3</property>
            <child>
              <widget class="GtkLabel" id="label4">
                <property name="width_request">100</property>
                <property name="visible">True</property>
                <property name="xalign">1</property>
                <property name="label" translatable="yes">ZIP code: </property>
              </widget>
              <packing>
                <property name="expand">False</property>
              </packing>
            </child>
            <child>
              <widget class="GtkEntry" id="EntryZip">
                <property name="visible">True</property>
                <property name="can_focus">True</property>
              </widget>
              <packing>
                <property name="position">1</property>
              </packing>
            </child>
            <child>
              <placeholder/>
            </child>
          </widget>
          <packing>
            <property name="padding">1</property>
            <property name="position">6</property>
          </packing>
        </child>
        <child>
          <widget class="GtkHBox" id="hbox7">
            <property name="visible">True</property>
            <property name="border_width">3</property>
            <child>
              <widget class="GtkLabel" id="label5">
                <property name="width_request">100</property>
                <property name="visible">True</property>
                <property name="xalign">1</property>
                <property name="label" translatable="yes">Phone: </property>
              </widget>
              <packing>
                <property name="expand">False</property>
              </packing>
            </child>
            <child>
              <widget class="GtkEntry" id="EntryPhone">
                <property name="visible">True</property>
                <property name="can_focus">True</property>
              </widget>
              <packing>
                <property name="position">1</property>
              </packing>
            </child>
            <child>
              <placeholder/>
            </child>
          </widget>
          <packing>
            <property name="padding">1</property>
            <property name="position">7</property>
          </packing>
        </child>
        <child>
          <widget class="GtkHSeparator" id="hseparator1">
            <property name="visible">True</property>
          </widget>
          <packing>
            <property name="expand">False</property>
            <property name="padding">4</property>
            <property name="position">8</property>
          </packing>
        </child>
        <child>
          <widget class="GtkHBox" id="hbox8">
            <property name="visible">True</property>
            <property name="border_width">3</property>
            <child>
              <widget class="GtkButton" id="Entry_Can_Button">
                <property name="visible">True</property>
                <property name="can_focus">True</property>
                <property name="receives_default">True</property>
                <property name="label" translatable="yes">gtk-close</property>
                <property name="use_stock">True</property>
                <property name="response_id">0</property>
              </widget>
              <packing>
                <property name="expand">False</property>
                <property name="fill">False</property>
              </packing>
            </child>
            <child>
              <placeholder/>
            </child>
            <child>
              <widget class="GtkButton" id="Entry_Ok_Button">
                <property name="visible">True</property>
                <property name="can_focus">True</property>
                <property name="receives_default">True</property>
                <property name="label" translatable="yes">gtk-save</property>
                <property name="use_stock">True</property>
                <property name="response_id">0</property>
              </widget>
              <packing>
                <property name="expand">False</property>
                <property name="fill">False</property>
                <property name="pack_type">GTK_PACK_END</property>
                <property name="position">2</property>
              </packing>
            </child>
          </widget>
          <packing>
            <property name="expand">False</property>
            <property name="fill">False</property>
            <property name="padding">1</property>
            <property name="pack_type">GTK_PACK_END</property>
            <property name="position">9</property>
          </packing>
        </child>
      </widget>
    </child>
  </widget>
  <widget class="GtkWindow" id="Main_Window">
    <property name="width_request">500</property>
    <property name="height_request">400</property>
    <property name="visible">True</property>
    <property name="title" translatable="yes">Address Book</property>
    <property name="icon">supertux.xpm</property>
    <child>
      <widget class="GtkVBox" id="vbox2">
        <property name="visible">True</property>
        <child>
          <widget class="GtkMenuBar" id="menubar1">
            <property name="visible">True</property>
            <child>
              <widget class="GtkMenuItem" id="menuitem5">
                <property name="visible">True</property>
                <property name="label" translatable="yes">_File</property>
                <property name="use_underline">True</property>
                <child>
                  <widget class="GtkMenu" id="menu4">
                    <property name="visible">True</property>
                    <child>
                      <widget class="GtkImageMenuItem" id="imagemenuitem15">
                        <property name="visible">True</property>
                        <property name="label" translatable="yes">gtk-quit</property>
                        <property name="use_underline">True</property>
                        <property name="use_stock">True</property>
                      </widget>
                    </child>
                  </widget>
                </child>
              </widget>
            </child>
            <child>
              <widget class="GtkMenuItem" id="menuitem8">
                <property name="visible">True</property>
                <property name="label" translatable="yes">_Help</property>
                <property name="use_underline">True</property>
                <child>
                  <widget class="GtkMenu" id="menu6">
                    <property name="visible">True</property>
                    <child>
                      <widget class="GtkImageMenuItem" id="imagemenuitem20">
                        <property name="visible">True</property>
                        <property name="label" translatable="yes">gtk-about</property>
                        <property name="use_underline">True</property>
                        <property name="use_stock">True</property>
                      </widget>
                    </child>
                  </widget>
                </child>
              </widget>
            </child>
          </widget>
          <packing>
            <property name="expand">False</property>
          </packing>
        </child>
        <child>
          <widget class="GtkHBox" id="hbox9">
            <property name="visible">True</property>
            <property name="border_width">5</property>
            <child>
              <widget class="GtkFrame" id="frame1">
                <property name="visible">True</property>
                <property name="label_xalign">0</property>
                <child>
                  <widget class="GtkAlignment" id="alignment1">
                    <property name="visible">True</property>
                    <property name="top_padding">5</property>
                    <property name="bottom_padding">5</property>
                    <property name="left_padding">5</property>
                    <property name="right_padding">5</property>
                    <child>
                      <widget class="GtkScrolledWindow" id="Scrolled_Window">
                        <property name="visible">True</property>
                        <property name="can_focus">True</property>
                        <property name="extension_events">GDK_EXTENSION_EVENTS_CURSOR</property>
                        <property name="border_width">2</property>
                        <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
                        <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
                        <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
                        <child>
                          <placeholder/>
                        </child>
                      </widget>
                    </child>
                  </widget>
                </child>
                <child>
                  <placeholder/>
                  <packing>
                    <property name="type">label_item</property>
                  </packing>
                </child>
              </widget>
              <packing>
                <property name="padding">5</property>
              </packing>
            </child>
            <child>
              <widget class="GtkFrame" id="frame2">
                <property name="visible">True</property>
                <property name="label_xalign">0</property>
                <child>
                  <widget class="GtkVBox" id="vbox3">
                    <property name="visible">True</property>
                    <property name="border_width">5</property>
                    <child>
                      <widget class="GtkButton" id="Add_Button">
                        <property name="visible">True</property>
                        <property name="can_focus">True</property>
                        <property name="receives_default">True</property>
                        <property name="label" translatable="yes">gtk-add</property>
                        <property name="use_stock">True</property>
                        <property name="response_id">0</property>
                      </widget>
                      <packing>
                        <property name="expand">False</property>
                        <property name="padding">2</property>
                      </packing>
                    </child>
                    <child>
                      <widget class="GtkButton" id="Del_Button">
                        <property name="visible">True</property>
                        <property name="can_focus">True</property>
                        <property name="receives_default">True</property>
                        <property name="label" translatable="yes">gtk-remove</property>
                        <property name="use_stock">True</property>
                        <property name="response_id">0</property>
                      </widget>
                      <packing>
                        <property name="expand">False</property>
                        <property name="padding">2</property>
                        <property name="position">1</property>
                      </packing>
                    </child>
                    <child>
                      <widget class="GtkButton" id="Edit_Button">
                        <property name="visible">True</property>
                        <property name="can_focus">True</property>
                        <property name="receives_default">True</property>
                        <property name="label" translatable="yes">gtk-edit</property>
                        <property name="use_stock">True</property>
                        <property name="response_id">0</property>
                      </widget>
                      <packing>
                        <property name="expand">False</property>
                        <property name="padding">2</property>
                        <property name="position">2</property>
                      </packing>
                    </child>
                    <child>
                      <placeholder/>
                    </child>
                    <child>
                      <widget class="GtkButton" id="Exit_Button">
                        <property name="visible">True</property>
                        <property name="can_focus">True</property>
                        <property name="receives_default">True</property>
                        <property name="label" translatable="yes">gtk-quit</property>
                        <property name="use_stock">True</property>
                        <property name="response_id">0</property>
                      </widget>
                      <packing>
                        <property name="expand">False</property>
                        <property name="padding">2</property>
                        <property name="pack_type">GTK_PACK_END</property>
                        <property name="position">4</property>
                      </packing>
                    </child>
                  </widget>
                </child>
                <child>
                  <placeholder/>
                  <packing>
                    <property name="type">label_item</property>
                  </packing>
                </child>
              </widget>
              <packing>
                <property name="expand">False</property>
                <property name="fill">False</property>
                <property name="padding">5</property>
                <property name="position">1</property>
              </packing>
            </child>
          </widget>
          <packing>
            <property name="position">1</property>
          </packing>
        </child>
        <child>
          <widget class="GtkStatusbar" id="statusbar1">
            <property name="visible">True</property>
            <property name="spacing">2</property>
          </widget>
          <packing>
            <property name="expand">False</property>
            <property name="position">2</property>
          </packing>
        </child>
      </widget>
    </child>
  </widget>
</glade-interface>

95
GTK-Server / Gtk Themes
« on: August 22, 2010, 04:47:35 PM »
I installed the latest Gtk 2 with theme management and thought I would share a few of my favorites. (out of about 100)















Note: The Glade Windows installer has a couple issues. The start menu shortcut doesn't start glade in the bin directory and can't find it's required DLL. UnZip the attached file in the C:\Program Files\Glade\share\icons\hicolor (or where you installed Glade) directory or you won't have any toolbar icons.

96
Wish List / RT Extension Module
« on: August 14, 2010, 10:57:36 PM »
I would like to see a Run Thread extension module. The ScriptBasic HTTP application server spawns threads in the same process and can share variables between threads. (with locking R/W feature) The ability to RUN script threads and share COMMON variables would enhance the command line interpreter by offering multi-threading support in an easy to use way.

Update

I created the SBT extension module to grant myself this wish.

97
What's New / ScriptBasic 3.0 Open Items
« on: August 13, 2010, 09:20:46 PM »
Here is a list of tasks for the 3.0 release. If you have some time to contribute to the ScriptBasic project, your efforts will count in a big way towards making ScriptBasic an industry standard scripting language.

  • Finish mini-XML extension module
  • Finish make build system
  • Create ScriptBasic program to parse the C source and generate current HTML docs
  • Finish math functions in the core interpreter that are now non-functioning stub C functions (Tom and Armando are looking into this.)
  • Finish remote debugger preprocessor
  • Create IDE/Debugger with new GUI extension module
  • Create Windows install for binary only distribution
  • Migrate new make build system to Linux and OS X
  • Create distributions for all major platforms
  • Add Rlib reporting engine as a ScriptBasic extension module. (John is working on this with a prototype done with GTK-Server as a POC)


If any of the above items are within your skill level and you're able to help with the project, please respond with what task you would like to work on.

98
Round Table / Feedback Request
« on: July 21, 2010, 10:29:56 AM »
I have noticed that ScriptBasic is being downloaded on a daily basis yet no one is commenting on their experience with the Basic.

  • Did you have any issue getting ScriptBasic to work on your system?
  • What version of Windows did you try ScriptBasic on?
  • What areas do you plan to use ScriptBasic in your projects?
  • Have you tried ScriptBasic in the 64-bit environment yet?
  • Have you tried the Linux or Mac version yet?
  • What suggestions do you have to create more of a community around ScriptBasic?


99
Download / ScriptBasic 3.0 w/GUI
« on: July 19, 2010, 09:42:10 PM »
This ScriptBasic 3.0 Windows 32-bit runtime download includes the first release of the IUP GUI extension module.

DOWNLOAD

The Thesaurus IUP demo by Armando Rivera was based on Peter van Eerten's Gtk-Server Thesaurus demo.



Code: [Select]
import IUP.bas

GLOBAL CONST title = "Thesaurus!"

'Servers = "1=dict.org, 2=test.dict.org, 3=dict.die.net"
Servers[0]="dict.org"
Servers[1]="dict1.us.dict.org"
Servers[2]="all.dict.org"

about=""" This is a Demo
of the IUP GUI Binding
for Scriptbasic"""

const nl = "\n"

SUB CLEAR
IUP::AddItem(serverList,"")
END SUB

SUB Get_Dicts(svrAddr)

LOCAL dat$, total, count

ON ERROR GOTO G_NetError

OPEN svrAddr & ":2628" FOR SOCKET AS 1
PRINT#1,"SHOW DB\n"

LINE INPUT#1, dat$
LINE INPUT#1, dat$

count = 0
WHILE LEFT(dat$, 1) <> "."
LINE INPUT#1, dat$
IF LEFT(dat$, 1) <> "." THEN total[count] = TRIM(dat$)
count+=1
WEND
PRINT#1,"QUIT\n"
CLOSE 1


for cnt = 0 to count
IUP::AddItem(serverList, total[cnt])
next

EXIT SUB

G_NetError:
'IUP::Message("ERROR Connecting" , svrAddr & " is not available!")
print "Server not available",nl


END SUB

SUB Lookup_Word

LOCAL dict$, dat$, total$, info$

IUP::SetText(win, title & " -  " & IUP::GetText(entry))

IUP::SetText(text, "Fetching....")


ON ERROR GOTO L_NetError

selectedServer = Servers[IUP::GetSelection(serverCombo) -1]

'THIS DOESN'T WORK YET
'whichDictionary = IUP::GetText(serverList)

'print whichDictionary

'dict$ = LEFT(whichDictionary, INSTR(whichDictionary, " "))

'print dict$

OPEN selectedServer & ":2628" FOR SOCKET AS 1

IF IUP::GetState(chkAll) = "ON" THEN
PRINT#1,"DEFINE * " & IUP::GetText(entry) & "\n"
ELSE
PRINT#1,"DEFINE " & dict$ & " " & IUP::GetText(entry)& "\n"
END IF

REPEAT
LINE INPUT#1, dat$
'dat$ = REPLACE(dat$, CHR$(34), CHR$(92) & CHR$(34))
IF LEFT(dat$, 3) = "151" THEN
total$ &= "------------------------------\n"
total$ &= RIGHT(dat$, LEN(dat$) - LEN(IUP::GetText(entry)) - 9)
total$ &= "------------------------------\n"
REPEAT
LINE INPUT#1, info$
'info$ = REPLACE(info$, CHR$(34), CHR$(92) & CHR$(34))
IF LEFT(info$, 1) <> "." THEN total$ &= TRIM(info$) & nl
UNTIL LEFT(info$, 1) = "."
total$ &= "\n"
END IF
UNTIL LEFT(dat$, 3) = "250" OR VAL(LEFT(dat$, 3)) > 499

PRINT#1,"QUIT\n"
CLOSE 1

IF LEFT(dat$, 3) = "552" THEN
total$ = "No match found."
ELSE IF LEFT(dat$, 3) = "501" THEN
total$ = "Select a dictionary first!"
ELSE IF LEFT(dat$, 3) = "550" THEN
total$ = "Invalid database!"
END IF

IUP::SetText(text, total$)

EXIT SUB

L_NetError:
        dat$[0] = "Could not lookup word!"

        IUP::SetText(text, dat$)

END SUB

REM Initialize IUP
IUP::Init()

REM Create Main Window
win = IUP::Create("dialog","TITLE=Thesaurus, SIZE=500x300")

REM create container to house ALL GUI objects
vbox = IUP::Create("vbox","MARGIN=10x10")

REM Create Server panel
topBox = IUP::Create("hbox", " GAP=10", vbox)
serverFrame = IUP::Create("frame", "TITLE=Servers, EXPAND=YES", topBox)
serverBox= IUP::Create("hbox", "GAP=5", serverFrame)
serverCombo = IUP::Create("list", "DROPDOWN=YES, SIZE=120x, EXPAND=HORIZONTAL, VALUE=1", serverBox)
btnFetch = IUP::Create("button", "TITLE=Fetch, SIZE = 50x", serverBox)



REM Create control panel
controlFrame = IUP::Create("frame", "TITLE=Controls", topBox)
controlBox = IUP::Create("hbox", "Margin=6x6, GAP=5", controlFrame)
btnAbout = IUP::Create("button", "TITLE=About, SIZE = 50x", controlBox)
btnClear = IUP::Create("button", "TITLE=Clear, SIZE = 50x", controlBox)
btnExit = IUP::Create("button", "TITLE=Exit, SIZE = 50x", controlBox)

REM Create dictionary panel
dictFrame = IUP::Create("frame", "TITLE=Dictionaries", vbox)
serverList = IUP::Create("list", "EXPAND=YES, VISIBLELINES=1", dictFrame)

REM Create text part
transFrame = IUP::Create("frame", "TITLE=Translation", vbox)
text = IUP::Create("text", "MULTILINE=YES, EXPAND=YES", transFrame)

REM Create entry and search button
bottomBox = IUP::Create("hbox", "GAP=10", vbox)
label = IUP::Create("label", "TITLE=\"Enter Word to Search For:\", SIZE=x12", bottomBox)
entry = IUP::Create("text", " EXPAND=HORIZONTAL",bottomBox)
btnSearch = IUP::Create("button","TITLE=Search, SIZE=50x", bottomBox)
chkAll = IUP::Create("toggle", "TITLE=ALL, VALUE=ON,SIZE=x12", bottomBox)
chkUTF = IUP::Create("toggle", "TITLE=UTF-8, SIZE=x12", bottomBox)

REM Add the main GUI container to the Window
IUP::AddChild(win, vbox)

REM Show the Window
IUP::Show(win)

IUP::SetFocus(btnFetch)
for i = 0 to 2
IUP::AddItem(serverCombo, Servers[i])
next

repeat
IUP::Wait()

action = IUP::Event()
eventtype = IUP::EventType()

if action = btnAbout then
IUP::Message("ABOUT", about)
end if

if action = btnFetch then
selection = IUP::GetSelection(serverCombo)
Get_Dicts(Servers[selection-1])
end if

if action = btnClear then

end if

if action = btnSearch then
Lookup_Word()
end if

until action = win or action = btnExit


Print "All Done"

Code: [Select]
module iup

REM """
The module iup.bas is based on the iup library.
"""
' FUNCTION DECLARATIONS
declare sub     ::Init          alias "Init"        lib "iup"
declare sub     ::Show          alias "Show"        lib "iup"
declare sub     ::Destroy       alias "Destroy"     lib "iup"
declare sub     ::Close         alias "Close"       lib "iup"
declare sub     ::Create        alias "Create"      lib "iup"
declare sub     ::AddChild      alias "AddChild"    lib "iup"
declare sub     ::Wait          alias "Wait"        lib "iup"
declare sub     ::ExitLoop      alias "ExitLoop"    lib "iup"
declare sub     ::Event         alias "GetEvent"    lib "iup"
declare sub     ::SetText       alias "SetText"     lib "iup"
declare sub     ::GetText       alias "GetText"     lib "iup"
declare sub     ::SetItem       alias "SetItem"     lib "iup"
declare sub     ::GetItem       alias "GetItem"     lib "iup"
declare sub     ::GetState      alias "GetItem"     lib "iup"
declare sub     ::SetFocus      alias "Focus"       lib "iup"
declare sub     ::Message       alias "Message"     lib "iup"
declare sub     ::GetClass      alias "GetClass"    lib "iup"
declare sub     ::GetSelection  alias "GetItem"     lib "iup"
declare sub     ::AddItem       alias "AddItem"     lib "iup"
declare sub     ::EventType     alias "EventType"   lib "iup"
end module

100
Tutorials / cURL Example
« on: July 10, 2010, 10:41:36 PM »
The following cURL extension module example retrieves a web page HTML and saves it to your PC. (webget)

Code: [Select]
' cURL webget

INCLUDE curl.bas

ch = curl::init()
curl::option(ch,"URL","http://scriptbasic.com/html/general.html")
curl::option(ch,"FILE","general.html")
curl::perform(ch)
curl::finish(ch)

cURL extension module documentation


Here is a webget by opening a TCP socket using ScriptBasic.

Code: [Select]
OPEN "scriptbasic.com/html/general.html:80" for SOCKET AS #1
PRINT #1,"GET http://localhost/ HTTP/1.0\n\n"
WHILE NOT EOF(1)
  LINE INPUT #1, content
  PRINT content
WEND
CLOSE(1)

101
Tutorials / REF for complex structures
« on: July 09, 2010, 04:36:54 PM »
The ScriptBasic REF statement allows for building complex variable structures in a more nature Basic way.

Code: [Select]
REF customer = addr
REF customer = phone
REF customer = bal

customer{"id"} = 1

addr{"name"} = "John Doe"
addr{"street"} = "Main St."
addr{"city"} = "Anytown"
addr{"state"} = "Unknown"

phone{"work"} = "800-555-1234"
phone{"home"} = "888-4444"

bal[30] = 100
bal[60] = 250
bal[90] = 0

PRINT customer{"id"},"\n"
PRINT customer{"name"},"\n"
PRINT customer{"street"},"\n"
PRINT customer{"city"},"\n"
PRINT customer{"state"},"\n"
PRINT customer{"work"},"\n"
PRINT customer{"home"},"\n"
PRINT customer[30],"\n"
PRINT customer[60],"\n"
PRINT customer[90],"\n"

C:\scriptbasic\test>reftest
1
John Doe
Main St.
Anytown
Unknown
800-555-1234
888-4444
100
250
0

REF

Array Mix Mode

Another example of accessing an associative array.

Code: [Select]
addr{"name"} = "John Doe"
addr{"street"} = "Main St."
addr{"city"} = "Anytown"
addr{"state"} = "Unknown"

FOR x = LBOUND(addr) TO UBOUND(addr)STEP 2
  PRINT addr[x],"=",addr{addr[x]},"\n"
NEXT x

C:\scriptbasic\test>aatest
name=John Doe
street=Main St.
city=Anytown
state=Unknown

102
Tutorials / MySQL & ODBC Examples
« on: July 08, 2010, 11:53:28 PM »
I thought I would post a couple quick examples of using the MySQL C API and ODBC extension modules with ScriptBasic.

Code: MySQL
  1. include "C:\scriptbasic\include\mysql.bas"
  2.  
  3. dbh = mysql::RealConnect("host","user","password","DB")
  4.  
  5. mysql::query(dbh,"SELECT * FROM bible WHERE word_name LIKE 'am%'")
  6.  
  7. WHILE mysql::FetchHash(dbh, column)
  8.  
  9.   PRINT LEFT(column{"word_name"} & STRING(30," "),30),column{"word_count"},"\n"
  10.  
  11. WEND
  12.  
  13. mysql::Close(dbh)
  14.  

Code: Text
  1. include "C:\scriptbasic\include\odbc.bas"
  2.  
  3. dbh = odbc::RealConnect("DSN","user","password")
  4.  
  5. odbc::query(dbh,"SELECT * FROM bible WHERE word_name LIKE 'am%'")
  6.  
  7. WHILE odbc::FetchHash(dbh,column)
  8.  
  9.   PRINT LEFT(column{"word_name"} & STRING(30," "),30),column{"word_count"},"\n"
  10.  
  11. WEND
  12.  
  13. odbc::Close(dbh)
  14.  

Code: Text
  1. C:\scriptbasic\test>odbctest
  2. am                            164
  3. ama                           1
  4. amabit                        1
  5. amad                          1
  6. amalek                        15
  7. amalekites                    9
  8. amam                          1
  9. amazed                        1
  10. ambassadors                   2
  11. ambrose                       2
  12. ambrosianum                   1
  13. ambush                        7
  14. amen                          15
  15. amend                         1
  16. amending                      1
  17. amends                        1
  18. amerce                        1
  19. amethyst                      2
  20. ammiel                        1
  21. ammihud                       7
  22. amminadab                     6
  23. ammishaddai                   5
  24. ammon                         38
  25. ammonite                      1
  26. ammonites                     1
  27. among                         281
  28. amongst                       2
  29. amorite                       9
  30. amorites                      62
  31. amos                          1
  32. amram                         6
  33. amram's                       1
  34. amramites                     1
  35. amraphel                      2
  36.  

The ODBC example is using the MySQL ODBC Connector driver. Both examples are accessing the same MySQL database table and produce the same results.

103
Download / ScriptBasic 3.0 Windows 32/64
« on: July 05, 2010, 11:18:41 AM »


The ScriptBasic open source project development team has made available a release candidate for the new 3.0 release for Windows 32/64 platforms. The source has been compiled with the TDM MinGW/GCC C/C++ compiler. The pre-compiled runtime binaries for both 32 and 64 Windows platforms are available for download as is the common source for ScriptBasic. Please help the project out with testing and providing feedback for the new 3.0 pre-release.

Quote from: Armando Rivera
Source.

New makefile target:  install

After building with -m32 or -m64, do:

make install DIR={where you want to install}

For example, after building the 64bit version, I did:

make install DIR=c:\Scriptbasic64.

The DIR= part is REQUIRED.  Limitation of the Windows Shell (bash would have made the entire Makefile a piece of cake).

There's no target for uninstall; it's easy to implement but I want YOU to do it (only way to learn).

libxml is removed, and replaced with mxml.

mxml module currently has the following functions:

"LoadDoc"
"GetNext"
"GetChild"
"GetNodeValue"
"GetNode"
"SaveDoc"
"NewDoc"
"FreeDoc"
"GetProperty"

See the interface.c file for more info about each function (you should be able to generate the html pages, I think, using Perl).

The mxml.zip file contains libmxml.a files for 32 and 64 bit modes and should be copied to your MinGW include directory by platform.

ScriptBasic 3.0 Windows 64 Binaries






104
What's New / ScriptBasic 32 bit Windows
« on: July 04, 2010, 02:14:42 AM »
I will be posting a release candidate for the 32 bit version of Armando's work with the 64 bit ScriptBasic effort using the GCC / MinGW C/C++ compiler. Armando has sent me the ZLIB and new XML extension modules to test. I will include a batch file to convert ScriptBasic applications to a standalone executable using a shared object runtime using this same compiler.

I have noticed in the site logs that there have been daily downloads of ScriptBasic. It would be great to hear some feedback from the users for a change.  :(

105
What's New / ScriptBasic 64 bit Windows
« on: June 26, 2010, 08:43:39 AM »
I would like to thank Armando Rivera for helping out the ScriptBasic open source project once again and creating a 64 bit version of the core executables for Windows.

  • scriba - Command line interpreter
  • sbhttpd - Multi-threaded web server
  • libscriba - Runtime shared object (DLL) for your compiled ScriptBasic applications to C



Quote from: Armando Rivera
You wondered, and so did I.

Cheesy makefile, but it works.

64-BIT scriba/sbhttpd/dll (with import library named scriba_imp.a) compiled with MinGW64 for Windows.  No extension modules, though. I'll leave that to you.

If you want to compile this as 32bit, change -m64 to -m32 in the makefile.

Not tested, that's your job. The executables run, though.



Pages: 1 ... 5 6 [7] 8 9 ... 12