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 ... 4 5 [6] 7 8 ... 12
76
Download / ScriptBasic CentOS 64
« on: November 28, 2011, 12:16:46 AM »
I have compiled and attached a runtime set of binaries for ScriptBasic running on CentOS 5 (Red Hat 5) 64 bit.

Let me know if you have any issues or questions using this release. ( support@scriptbasic.org )

77
IUP / IUP Linux and Windows
« on: November 03, 2011, 10:27:21 PM »
I'm glad that everyone is happy with GTK-Server but if you would have looked behind door #2, ...   ;)

The following is the status of the core IUP extension module. Functions that start with a * haven't been implemented yet. (stubs)

TODO List
  • Variable number of arguments for IUP functions that support it.
  • Return IUP name lists in an array. (like Iup::Info)
  • Bring callback handling internal to the extension module.
  • Add all the other IUP goodies (plot, GL, grids, ...)

IUP is an extensive library and wrapping it to work with ScriptBasic is going to take time. The SB macros help a lot but there is always something that crops up that puts the wagons in a circle.


System
Iup::Open
Iup::Close
Iup::Version
Iup::Load
Iup::LoadBuffer
Iup::SetLanguage
Iup::GetLanguage

Attribute
Iup::StoreAttribute
Iup::StoreGlobalAttribute
Iup::StoreAttributeId
Iup::StoreGlobalAttributeId
Iup::SetAttribute
Iup::SetGlobalAttribute
Iup::SetAttributeId
Iup::SetGlobalAttributeId
Iup::SetfAttribute
Iup::SetfAttributeId
Iup::SetfAttributeId2
Iup::SetAttributes
Iup::ResetAttribute
Iup::ResetGlobalAttribute
Iup::SetAtt
Iup::SetAttributeHandle
Iup::GetAttributeHandle
Iup::GetAttribute
Iup::GetAttributeId
Iup::GetAllAttributes
Iup::GetAttributes
Iup::GetFloat
Iup::GetFloatId
Iup::GetFloatId2
Iup::GetInt
Iup::GetInt2
* Iup::GetIntInt
Iup::GetIntId
Iup::GetIntId2
Iup::StoreGlobal
Iup::SetGlobal
Iup::GetGlobal

Events
GetEvent  (used internally)
Iup::MainLoop
Iup::MainLoopLevel
Iup::LoopStep
Iup::LoopStepWait
Iup::ExitLoop
Iup::Flush
Iup::GetCallback
Iup::SetCallback
* Iup::SetCallbacks
Iup::GetActionName
Iup::SetFunction
Iup::RecordInput
Iup::PlayInput

Layout
Iup::Create
Iup::Destroy
Iup::Map
Iup::Unmap
Iup::GetAllClasses
Iup::GetClassName
Iup::GetClassType
Iup::ClassMatch
Iup::GetClassAttributes
Iup::GetClassCallbacks
Iup::SaveClassAttributes
Iup::CopyClassAttributes
Iup::SetClassDefaultAttribute
Iup::Fill
Iup::Hbox
Iup::Vbox
Iup::Zbox
Iup::Radio
Iup::Normalizer
Iup::Cbox
Iup::Sbox
Iup::Split
Iup::Append
Iup::Detach
Iup::Insert
Iup::InsertTop
Iup::Reparent
Iup::GetParent
Iup::GetChild
Iup::GetChildPos
Iup::GetChildCount
Iup::GetNextChild
Iup::GetBrother
Iup::GetDialog
Iup::GetDialogChild
Iup::Refresh
Iup::RefreshChildren
Iup::Update
Iup::UpdateChildren
Iup::Redraw
Iup::ConvertXYToPos

Dialog
Iup::Dialog
Iup::Popup
Iup::Show
Iup::ShowXY
Iup::Hide
Iup::FileDlg
Iup::MessageDlg
Iup::ColorDlg
Iup::FontDlg
Iup::Alarm
Iup::GetFile
Iup::GetColor
* Iup::GetParam
Iup::GetText
* Iup::ListDialog
Iup::Message
Iup::LayoutDialog
Iup::ElementPropertiesDialog

Controls
Iup::Button
Iup::Canvas
Iup::Frame
Iup::Label
Iup::List
Iup::MultiLine
Iup::ProgressBar
Iup::Spin
Iup::Tabs
* Iup::Tabsv
Iup::Text
Iup::Toggle
Iup::Tree
Iup::Val

Resources
Iup::Image
Iup::ImageRGB
Iup::ImageRGBA
Iup::NextField
Iup::PreviousField
Iup::GetFocus
Iup::SetFocus
Iup::Item
Iup::Menu
* Iup::Menuv
Iup::Separator
Iup::Submenu
Iup::SetHandle
Iup::GetHandle
Iup::GetName
Iup::GetAllNames
Iup::GetAllDialogs
Iup::Clipboard
Iup::Timer
Iup::User
Iup::Help

Helper Functions
Iup::GetListText
Iup::Info


IUP Control Gallery

IUP Project Site

78
General Discussions / phpMyAdmin
« on: October 28, 2011, 09:23:08 PM »
phpMyAdmin is a free software tool written in PHP intended to handle the administration of MySQL over the World Wide Web. phpMyAdmin supports a wide range of operations with MySQL. The most frequently used operations are supported by the user interface (managing databases, tables, fields, relations, indexes, users, permissions, etc), while you still have the ability to directly execute any SQL statement.


Project Web Site


79
Tutorials / RLIB - Report Writer
« on: October 28, 2011, 08:14:55 PM »
I have RLIB built under Ubuntu 64  and my preliminary testing using existing example code shows promise. I plan to show a scripted example of using this report writer.

Quote
RLIB is an advanced reporting engine that generates professional reports in PDF, HTML, CSV, and text formats from a simple XML definition language.










RLIB Project Site


80
Tutorials / SBGtk Calc
« on: October 26, 2011, 07:22:47 PM »
This is a scripted calculator example using a Glade GUI designer XML project file.



calc.sb
Code: [Select]
' Gtk Calculator

DECLARE SUB DLL ALIAS "_idll" LIB "gtk-server"
DECLARE SUB VARPTR ALIAS "varptr" LIB "gtk-server"
DECLARE SUB REQUIRE ALIAS "_idll_require" LIB "gtk-server"
DECLARE SUB DEFINE ALIAS "_idll_define" LIB "gtk-server"

DEFINE "gtk_init NONE NONE 2 NULL NULL"
DEFINE "glade_init NONE NONE 0"
DEFINE "glade_xml_new NONE WIDGET 3 STRING NULL NULL"
DEFINE "glade_xml_signal_autoconnect NONE NONE 1 WIDGET"
DEFINE "glade_xml_get_widget NONE WIDGET 2 WIDGET STRING"
DEFINE "gtk_entry_get_text NONE STRING 1 WIDGET"
DEFINE "gtk_entry_set_text NONE NONE 2 WIDGET STRING"
DEFINE "gtk_button_get_label NONE STRING 1 WIDGET"
DEFINE "gtk_server_connect NONE STRING 3 STRING STRING STRING"
DEFINE "gtk_server_callback NONE STRING 1 STRING"
DEFINE "gtk_server_exit NONE NONE 0"


' Initialize calculator state
calculator_state = 0

' Initialize calculator cache
calculator_cache = 0

' Initialize last calculator action
calculator_action = 0

' Initialize MEM function
mem = 0

' Process the action
SUB Handle_Operator(entry)
  LOCAL value
  IF calculator_state = 0 THEN
    IF calculator_action = 1 THEN
      value = DLL("gtk_entry_get_text " & entry)
      calculator_cache += value
      DLL("gtk_entry_set_text " & entry & " " & calculator_cache)
    ELSE IF calculator_action = 2 THEN
      value = DLL("gtk_entry_get_text " & entry)
      calculator_cache -= value
      DLL("gtk_entry_set_text " & entry & " " & calculator_cache)
    ELSE IF calculator_action = 3 THEN
      value = DLL("gtk_entry_get_text " & entry)
      calculator_cache *= value
      DLL("gtk_entry_set_text " & entry & " " & calculator_cache)
    ELSE IF calculator_action = 4 THEN
      value = DLL("gtk_entry_get_text " & entry)
      IF value = 0 THEN
        DLL("gtk_entry_set_text " & entry & " ERROR")
      ELSE
        calculator_cache /= value
        DLL("gtk_entry_set_text " & entry & " " & calculator_cache)
      END IF
    END IF
  END IF
END SUB

' All button actions here
SUB Button_Memread(entry, widget)
  calculator_state = 0
  calculator_cache = DLL("gtk_entry_get_text " & entry)
  DLL("gtk_entry_set_text " & entry & " " & mem)
END SUB

SUB Button_Memadd(entry, widget)
  mem = DLL("gtk_entry_get_text " & entry)
END SUB

SUB Button_C(entry, widget)
  DLL("gtk_entry_set_text " & entry & " 0")
END SUB

SUB Button_CE(entry, widget)
  calculator_state = 0
  calculator_action = 0
  calculator_cache = 0
  mem = 0
  DLL("gtk_entry_set_text " & entry & " 0")
END SUB

SUB Button_Add(entry, widget)
    Handle_Operator(entry)
    calculator_action = 1
    calculator_state += 1
END SUB

SUB Button_Subtract(entry, widget)
    Handle_Operator(entry)
    calculator_action = 2
    calculator_state += 1
END SUB

SUB Button_Multiply(entry, widget)
    Handle_Operator(entry)
    calculator_action = 3
    calculator_state += 1
END SUB

SUB Button_Divide(entry, widget)
    Handle_Operator(entry)
    calculator_action = 4
    calculator_state += 1
END SUB

SUB Button_Equals(entry, widget)
    Handle_Operator(entry)
    calculator_action = 0
    calculator_state += 1
END SUB

SUB Button_Clicked(entry, widget)
    LOCAL button, text
    button = DLL("gtk_button_get_label " & widget)
    text = DLL("gtk_entry_get_text " & entry)
    IF text = "0" OR calculator_state > 0 THEN
      calculator_cache = text
      DLL("gtk_entry_set_text " & entry & " " & button)
    ELSE
      DLL("gtk_entry_set_text " & entry & " " & text & button)
    END IF
    calculator_state = 0
END SUB

' Main program
DLL("gtk_init NULL NULL")
DLL("glade_init")
xml = DLL("glade_xml_new \"calc.glade\" NULL NULL")
DLL("glade_xml_signal_autoconnect " & xml)

' Calc_Exit
win = DLL("glade_xml_get_widget " &  xml & " window")
DLL("gtk_server_connect " & win & " delete-event window")

' Entry
ent = DLL("glade_xml_get_widget " & xml & " entry")

' Button_Clicked
but1 = DLL("glade_xml_get_widget " &  xml & " button1")
DLL("gtk_server_connect " & but1 & " clicked button1")
but2 = DLL("glade_xml_get_widget " &  xml & " button2")
DLL("gtk_server_connect " & but2 & " clicked button2")
but3 = DLL("glade_xml_get_widget " &  xml & " button3")
DLL("gtk_server_connect " & but3 & " clicked button3")
but4 = DLL("glade_xml_get_widget " &  xml & " button4")
DLL("gtk_server_connect " & but4 & " clicked button4")
but5 = DLL("glade_xml_get_widget " &  xml & " button5")
DLL("gtk_server_connect " & but5 & " clicked button5")
but6 = DLL("glade_xml_get_widget " &  xml & " button6")
DLL("gtk_server_connect " & but6 & " clicked button6")
but7 = DLL("glade_xml_get_widget " &  xml & " button7")
DLL("gtk_server_connect " & but7 & " clicked button7")
but8 = DLL("glade_xml_get_widget " &  xml & " button8")
DLL("gtk_server_connect " & but8 & " clicked button8")
but9 = DLL("glade_xml_get_widget " &  xml & " button9")
DLL("gtk_server_connect " & but9 & " clicked button9")
but0 = DLL("glade_xml_get_widget " &  xml & " button0")
DLL("gtk_server_connect " & but0 & " clicked button0")

' Button_Add
butADD = DLL("glade_xml_get_widget " &  xml & " buttonAdd")
DLL("gtk_server_connect " & butADD & " clicked buttonAdd")

' Button_Subtract
butSUB = DLL("glade_xml_get_widget " &  xml & " buttonMinus")
DLL("gtk_server_connect " & butSUB & " clicked buttonMinus")

' Button_Multiply
butMUL = DLL("glade_xml_get_widget " &  xml & " buttonMul")
DLL("gtk_server_connect " & butMUL & " clicked buttonMul")

' Button_Divide
butDIV = DLL("glade_xml_get_widget " &  xml & " buttonDiv")
DLL("gtk_server_connect " & butDIV & " clicked buttonDiv")

' Button_Equals
butEQ = DLL("glade_xml_get_widget " &  xml & " buttonEq")
DLL("gtk_server_connect " & butEQ & " clicked buttonEq")

' Button_C
butC = DLL("glade_xml_get_widget " &  xml & " buttonC")
DLL("gtk_server_connect " & butC & " clicked buttonC")

' Button_CE
butCE = DLL("glade_xml_get_widget " &  xml & " buttonCE")
DLL("gtk_server_connect " & butCE & " clicked buttonCE")

' Button_Memadd
memadd = DLL("glade_xml_get_widget " &  xml & " buttonMemadd")
DLL("gtk_server_connect " & memadd & " clicked buttonMemadd")

' Button_Memread
memread = DLL("glade_xml_get_widget " &  xml & " buttonMemread")
DLL("gtk_server_connect " & memread & " clicked buttonMemread")

REPEAT
  event = DLL("gtk_server_callback wait")
  IF event = "button1" THEN Button_Clicked(ent, but1)
  IF event = "button2" THEN Button_Clicked(ent, but2)
  IF event = "button3" THEN Button_Clicked(ent, but3)
  IF event = "button4" THEN Button_Clicked(ent, but4)
  IF event = "button5" THEN Button_Clicked(ent, but5)
  IF event = "button6" THEN Button_Clicked(ent, but6)
  IF event = "button7" THEN Button_Clicked(ent, but7)
  IF event = "button8" THEN Button_Clicked(ent, but8)
  IF event = "button9" THEN Button_Clicked(ent, but9)
  IF event = "button0" THEN Button_Clicked(ent, but0)
  IF event = "buttonAdd" THEN Button_Add(ent, butADD)
  IF event = "buttonMinus" THEN Button_Subtract(ent, butSUB)
  IF event = "buttonMul" THEN Button_Multiply(ent, butMUL)
  IF event = "buttonDiv" THEN Button_Divide(ent, butDIV)
  IF event = "buttonEq" THEN Button_Equals(ent, butEQ)
  IF event = "buttonC" THEN Button_C(ent, butC)
  IF event = "buttonCE" THEN Button_CE(ent, butCE)
  IF event = "buttonMemadd" THEN Button_Memadd(ent, memadd)
  IF event = "buttonMemread" THEN Button_Memread(ent, memread)
UNTIL event = "window"

DLL("gtk_server_exit")
END

calc.glade
Code: [Select]
<?xml version="1.0"?>
<glade-interface>
  <widget class="GtkWindow" id="window">
    <property name="width_request">250</property>
    <property name="height_request">225</property>
    <property name="visible">True</property>
    <property name="title" translatable="yes">SBGtk Calculator</property>
    <property name="resizable">False</property>
    <property name="window_position">center</property>
    <property name="default_width">264</property>
    <property name="default_height">248</property>
    <property name="icon_name">calc</property>
    <child>
      <widget class="GtkTable" id="table1">
        <property name="visible">True</property>
        <property name="n_rows">5</property>
        <property name="n_columns">5</property>
        <property name="homogeneous">True</property>
        <child>
          <widget class="GtkButton" id="buttonMemadd">
            <property name="label" translatable="yes">M+</property>
            <property name="visible">True</property>
            <property name="can_focus">False</property>
            <property name="receives_default">False</property>
          </widget>
          <packing>
            <property name="left_attach">3</property>
            <property name="right_attach">4</property>
            <property name="top_attach">4</property>
            <property name="bottom_attach">5</property>
            <property name="x_padding">4</property>
            <property name="y_padding">8</property>
          </packing>
        </child>
        <child>
          <widget class="GtkEntry" id="entry">
            <property name="visible">True</property>
            <property name="sensitive">False</property>
            <property name="editable">False</property>
            <property name="xalign">1</property>
          </widget>
          <packing>
            <property name="right_attach">5</property>
            <property name="x_padding">4</property>
          </packing>
        </child>
        <child>
          <widget class="GtkButton" id="button1">
            <property name="label" translatable="yes">1</property>
            <property name="width_request">0</property>
            <property name="visible">True</property>
            <property name="can_focus">False</property>
            <property name="receives_default">False</property>
          </widget>
          <packing>
            <property name="top_attach">1</property>
            <property name="bottom_attach">2</property>
            <property name="x_padding">4</property>
            <property name="y_padding">8</property>
          </packing>
        </child>
        <child>
          <widget class="GtkButton" id="button3">
            <property name="label" translatable="yes">3</property>
            <property name="visible">True</property>
            <property name="can_focus">False</property>
            <property name="receives_default">False</property>
          </widget>
          <packing>
            <property name="left_attach">2</property>
            <property name="right_attach">3</property>
            <property name="top_attach">1</property>
            <property name="bottom_attach">2</property>
            <property name="x_padding">4</property>
            <property name="y_padding">8</property>
          </packing>
        </child>
        <child>
          <widget class="GtkButton" id="buttonC">
            <property name="label" translatable="yes">C</property>
            <property name="visible">True</property>
            <property name="can_focus">False</property>
            <property name="receives_default">False</property>
          </widget>
          <packing>
            <property name="left_attach">3</property>
            <property name="right_attach">4</property>
            <property name="top_attach">1</property>
            <property name="bottom_attach">2</property>
            <property name="x_padding">4</property>
            <property name="y_padding">8</property>
          </packing>
        </child>
        <child>
          <widget class="GtkButton" id="buttonCE">
            <property name="label" translatable="yes">CE</property>
            <property name="visible">True</property>
            <property name="can_focus">False</property>
            <property name="receives_default">False</property>
          </widget>
          <packing>
            <property name="left_attach">4</property>
            <property name="right_attach">5</property>
            <property name="top_attach">1</property>
            <property name="bottom_attach">2</property>
            <property name="x_padding">4</property>
            <property name="y_padding">8</property>
          </packing>
        </child>
        <child>
          <widget class="GtkButton" id="button4">
            <property name="label" translatable="yes">4</property>
            <property name="visible">True</property>
            <property name="can_focus">False</property>
            <property name="receives_default">False</property>
          </widget>
          <packing>
            <property name="top_attach">2</property>
            <property name="bottom_attach">3</property>
            <property name="x_padding">4</property>
            <property name="y_padding">8</property>
          </packing>
        </child>
        <child>
          <widget class="GtkButton" id="button5">
            <property name="label" translatable="yes">5</property>
            <property name="visible">True</property>
            <property name="can_focus">False</property>
            <property name="receives_default">False</property>
          </widget>
          <packing>
            <property name="left_attach">1</property>
            <property name="right_attach">2</property>
            <property name="top_attach">2</property>
            <property name="bottom_attach">3</property>
            <property name="x_padding">4</property>
            <property name="y_padding">8</property>
          </packing>
        </child>
        <child>
          <widget class="GtkButton" id="button6">
            <property name="label" translatable="yes">6</property>
            <property name="visible">True</property>
            <property name="can_focus">False</property>
            <property name="receives_default">False</property>
          </widget>
          <packing>
            <property name="left_attach">2</property>
            <property name="right_attach">3</property>
            <property name="top_attach">2</property>
            <property name="bottom_attach">3</property>
            <property name="x_padding">4</property>
            <property name="y_padding">8</property>
          </packing>
        </child>
        <child>
          <widget class="GtkButton" id="buttonAdd">
            <property name="label" translatable="yes">+</property>
            <property name="visible">True</property>
            <property name="can_focus">False</property>
            <property name="receives_default">False</property>
          </widget>
          <packing>
            <property name="left_attach">3</property>
            <property name="right_attach">4</property>
            <property name="top_attach">2</property>
            <property name="bottom_attach">3</property>
            <property name="x_padding">4</property>
            <property name="y_padding">8</property>
          </packing>
        </child>
        <child>
          <widget class="GtkButton" id="buttonMinus">
            <property name="label" translatable="yes">-</property>
            <property name="visible">True</property>
            <property name="can_focus">False</property>
            <property name="receives_default">False</property>
          </widget>
          <packing>
            <property name="left_attach">4</property>
            <property name="right_attach">5</property>
            <property name="top_attach">2</property>
            <property name="bottom_attach">3</property>
            <property name="x_padding">4</property>
            <property name="y_padding">8</property>
          </packing>
        </child>
        <child>
          <widget class="GtkButton" id="button7">
            <property name="label" translatable="yes">7</property>
            <property name="visible">True</property>
            <property name="can_focus">False</property>
            <property name="receives_default">False</property>
          </widget>
          <packing>
            <property name="top_attach">3</property>
            <property name="bottom_attach">4</property>
            <property name="x_padding">4</property>
            <property name="y_padding">8</property>
          </packing>
        </child>
        <child>
          <widget class="GtkButton" id="button8">
            <property name="label" translatable="yes">8</property>
            <property name="visible">True</property>
            <property name="can_focus">False</property>
            <property name="receives_default">False</property>
          </widget>
          <packing>
            <property name="left_attach">1</property>
            <property name="right_attach">2</property>
            <property name="top_attach">3</property>
            <property name="bottom_attach">4</property>
            <property name="x_padding">5</property>
            <property name="y_padding">8</property>
          </packing>
        </child>
        <child>
          <widget class="GtkButton" id="button9">
            <property name="label" translatable="yes">9</property>
            <property name="visible">True</property>
            <property name="can_focus">False</property>
            <property name="receives_default">False</property>
          </widget>
          <packing>
            <property name="left_attach">2</property>
            <property name="right_attach">3</property>
            <property name="top_attach">3</property>
            <property name="bottom_attach">4</property>
            <property name="x_padding">4</property>
            <property name="y_padding">8</property>
          </packing>
        </child>
        <child>
          <widget class="GtkButton" id="buttonMul">
            <property name="label" translatable="yes">*</property>
            <property name="visible">True</property>
            <property name="can_focus">False</property>
            <property name="receives_default">False</property>
          </widget>
          <packing>
            <property name="left_attach">3</property>
            <property name="right_attach">4</property>
            <property name="top_attach">3</property>
            <property name="bottom_attach">4</property>
            <property name="x_padding">4</property>
            <property name="y_padding">8</property>
          </packing>
        </child>
        <child>
          <widget class="GtkButton" id="buttonDiv">
            <property name="label" translatable="yes">/</property>
            <property name="visible">True</property>
            <property name="can_focus">False</property>
            <property name="receives_default">False</property>
          </widget>
          <packing>
            <property name="left_attach">4</property>
            <property name="right_attach">5</property>
            <property name="top_attach">3</property>
            <property name="bottom_attach">4</property>
            <property name="x_padding">4</property>
            <property name="y_padding">8</property>
          </packing>
        </child>
        <child>
          <widget class="GtkButton" id="button0">
            <property name="label" translatable="yes">0</property>
            <property name="visible">True</property>
            <property name="can_focus">False</property>
            <property name="receives_default">False</property>
          </widget>
          <packing>
            <property name="top_attach">4</property>
            <property name="bottom_attach">5</property>
            <property name="x_padding">4</property>
            <property name="y_padding">8</property>
          </packing>
        </child>
        <child>
          <widget class="GtkButton" id="buttonMemread">
            <property name="label" translatable="yes">MR</property>
            <property name="visible">True</property>
            <property name="can_focus">False</property>
            <property name="receives_default">False</property>
          </widget>
          <packing>
            <property name="left_attach">4</property>
            <property name="right_attach">5</property>
            <property name="top_attach">4</property>
            <property name="bottom_attach">5</property>
            <property name="x_padding">4</property>
            <property name="y_padding">8</property>
          </packing>
        </child>
        <child>
          <widget class="GtkButton" id="buttonEq">
            <property name="label" translatable="yes">=</property>
            <property name="visible">True</property>
            <property name="can_focus">False</property>
            <property name="receives_default">False</property>
          </widget>
          <packing>
            <property name="left_attach">1</property>
            <property name="right_attach">3</property>
            <property name="top_attach">4</property>
            <property name="bottom_attach">5</property>
            <property name="x_padding">4</property>
            <property name="y_padding">8</property>
          </packing>
        </child>
        <child>
          <widget class="GtkButton" id="button2">
            <property name="label" translatable="yes">2</property>
            <property name="visible">True</property>
            <property name="can_focus">False</property>
            <property name="receives_default">False</property>
          </widget>
          <packing>
            <property name="left_attach">1</property>
            <property name="right_attach">2</property>
            <property name="top_attach">1</property>
            <property name="bottom_attach">2</property>
            <property name="x_padding">4</property>
            <property name="y_padding">8</property>
          </packing>
        </child>
      </widget>
    </child>
  </widget>
</glade-interface>

81
Tutorials / FreeImage
« on: October 26, 2011, 09:29:28 AM »
Here is an example of scripting the FreeImage library under Linux. FreeImage is also available for Windows.

  • Get FreeImage version number
  • Get FreeImage copyright message
  • Load a jpg image
  • Get the image height and width
  • Rescale the jpg image from 225x225 to 100x100 using bicubic interpolation
  • Save the rescaled image as a png
  • Flip the original jpg image 180 degrees and save it as a png

Code: [Select]
DECLARE SUB DLL ALIAS "_idll" LIB "gtk-server"
DECLARE SUB VARPTR ALIAS "varptr" LIB "gtk-server"
DECLARE SUB REQUIRE ALIAS "_idll_require" LIB "gtk-server"
DECLARE SUB DEFINE ALIAS "_idll_define" LIB "gtk-server"

REQUIRE "libfreeimage.so"

DEFINE "FreeImage_GetVersion NONE STRING 0"
DEFINE "FreeImage_GetCopyrightMessage NONE STRING 0"
DEFINE "FreeImage_Load NONE LONG 3 INT STRING INT"
DEFINE "FreeImage_GetWidth NONE INT 1 LONG"
DEFINE "FreeImage_GetHeight NONE INT 1 LONG"
DEFINE "FreeImage_Rescale NONE LONG 4 LONG INT INT INT"
DEFINE "FreeImage_Save NONE BOOL 4 INT LONG STRING INT"
DEFINE "FreeImage_Rotate NONE LONG 3 LONG DOUBLE NULL"

CONST FIF_BMP  =  0
CONST FIF_JPEG =  2
CONST FIF_PNG  = 13
CONST FIF_GIF  = 25

CONST FILTER_BICUBIC = 1

PRINT DLL("FreeImage_GetVersion"),"\n"
PRINT DLL("FreeImage_GetCopyrightMessage"),"\n"
fbmp = DLL("FreeImage_Load " & FIF_JPEG & " \"world.jpg\" 0")
PRINT "Width: ",DLL("FreeImage_GetWidth " & fbmp),"\n"
PRINT "Height: ",DLL("FreeImage_GetHeight " & fbmp),"\n"
fbmps = DLL("FreeImage_Rescale " & fbmp & " 100 100 " & FILTER_BICUBIC)
DLL("FreeImage_Save " & FIF_PNG & " " & fbmps & " \"world_small.png\" 0")
fbmpr = DLL("FreeImage_Rotate " & fbmp & " 180 0")
DLL("FreeImage_Save " & FIF_PNG & " " & fbmpr & " \"world_flip.png\" 0")

Original .jpg image


Rescaled and converted to .png


Flipped 180 degrees


jrs@laptop:~/sb/FreeImage$ scriba fi.sb
3.13.1
This program uses FreeImage, a free, open source image library supporting all common bitmap formats. See http://freeimage.sourceforge.net for details
Width: 225
Height: 225
jrs@laptop:~/sb/FreeImage$


82
HASH / Hash Fix
« on: October 12, 2011, 10:31:08 AM »
I was testing the HASH extension module on my Ubuntu 64 system and noticed it had the old out of memory error when calling the ThisValue() function. I have attached the interface.c that was fixed by AIR.

Code: [Select]
IMPORT hash.bas

h = hash::New()
hash::SetValue(h,"A1234567890",1)
hash::SetValue(h,"B12345678901234567890",2)
hash::SetValue(h,"C123456789012345678901234567890",3)
hash::Start(h)

FOR x = 1 to 3
  PRINT hash::ThisKey(h), " - "
  PRINT hash::ThisValue(h),"\n"
  hash::Next(h)
NEXT x

hash::Release(h)

jrs@laptop:~/sb/test$ scriba testhash.sb
A1234567890 - 1
B12345678901234567890 - 2
C123456789012345678901234567890 - 3
jrs@laptop:~/sb/test$

83
Round Table / Site Issues
« on: September 28, 2011, 07:18:42 PM »
ScriptBasic Site Visitor,

I had to upgrade the server to PHP 5.3.8 due to a Wordpress update requirement. This broke the ScriptBasic home page (Mambo) and the wiki. (Mediawiki)  I'm working on the problems and will post something here once it's working again.

Sorry for the inconvenience.


84
General Discussions / SB2C
« on: August 29, 2011, 01:31:07 AM »
If anyone is interested in creating small footprint compiled (C) applications with ScriptBasic, here is how it's done. (Linux, Win & Mac 32/64 bit)

Note: Paths used in this example may need adjustment based on where you installed ScriptBasic and the Linux platform you're running under.

Example SB script.
Code: [Select]
for x=-5 to 5
  print x,"\n"
next

Creating the C wrapper of the above script.

scriba -Co testfor.c testfor.bas

Code: [Select]
/* FILE: testfor.c
   This file contains the binary code of a ScriptBasic program
   To run this file you have to compile it to object file and
   link it with scribast.lib or whatever the library code is
   called on your platform.
*/
unsigned long ulGlobalVariables=1;
unsigned long ulNodeCounter=20;
unsigned long ulStartNode=7;
unsigned long ulStringTableSize=10;
unsigned char szCommandArray[] ={
0xB8, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x76, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xCF, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x4D, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x42, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00 };
char szStringTable[]={
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x00,
0x00 };
#ifdef WIN32
main(int argc, char *argv[]){stndlone(argc,argv);}
#else
char **_environ;
main(int argc, char *argv[], char *env[]){stndlone(argc,argv,env);}
#endif
/*End of file testfor.c */

If you haven't created the sb.a runtime interface, here is how it's done.

cd /home/jrs/sb/scriptbasic/bin/obj/
ar rcs sb.a stndlone.o report.o myalloc.o errcodes.o dynlolib.o

chmod 755 sb.a
sudo cp sb.a /usr/lib

Make sure your ScriptBasic runtime shared object is present.

$ ls -l /usr/lib/libscriba*
-rwxr-xr-x 1 root root 1093954 2011-05-03 22:00 /usr/lib/libscriba.a
-rwxr-xr-x 1 root root  844476 2011-05-03 21:14 /usr/lib/libscriba.so

Looks like we are ready to compile our script.

$ gcc -Os testfor.c -I /home/jrs/sb/scriptbasic/ -ldl /usr/lib/sb.a -lscriba -lm -lpthread -o testfor

$ ./testfor
-5
-4
-3
-2
-1
0
1
2
3
4
5

$ ls -l testfor
-rwxr-xr-x 1 jrs jrs 29110 2011-08-29 00:17 testfor


This is an example of using the MySQL extension module and creating a standalone executable.

Code: [Select]
' MySQL Test Program

INCLUDE mysql.bas

dbh = mysql::RealConnect("host","user","password","dbname")

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

WHILE mysql::FetchHash(dbh,column)

PRINTNL
PRINT column{"ID"},"\n"
PRINT column{"NAME"},"\n"
PRINTNL

WEND

PRINTNL
PRINT "The database handle is: ",dbh,"\n"
PRINT "Affected rows by SELECT: ",mysql::AffectedRows(dbh),"\n"
PRINT "Character set name is: ",mysql::CharacterSetName(dbh),"\n"
PRINT "Last error is: ",mysql::ErrorMessage(dbh),"\n"
PRINT "Client info is: ",mysql::GetClientInfo(),"\n"
PRINT "Host info is: ",mysql::GetHostInfo(dbh),"\n"
PRINT "Proto info is: ",mysql::GetProtoInfo(dbh),"\n"
PRINT "Server info is: ",mysql::GetServerInfo(dbh),"\n"
PRINT "PING result: ",mysql::Ping(dbh),"\n"
PRINT "Thread ID: ",mysql::ThreadId(dbh),"\n"
PRINT "Status is: ",mysql::Stat(dbh),"\n"

mysql::Close(dbh)

END

$ scriba -Co tstsql.c testmysql.sb
$ gcc -Os tstsql.c -I /home/jrs/sb/scriptbasic/ -ldl /usr/lib/sb.a -lscriba -lm -lpthread -o tstsql
$ ./tstsql

1
John Spikowski


The database handle is: 1
Affected rows by SELECT: 1
Character set name is: latin1
Last error is:
Client info is: 5.1.54
Host info is: Localhost via UNIX socket
Proto info is: 10
Server info is: 5.1.54-1ubuntu4
PING result: -1
Thread ID: 0
Status is: Uptime: 28068  Threads: 1  Questions: 137  Slow queries: 0  Opens: 147  Flush tables: 1  Open tables: 35  Queries per second avg: 0.4

$ ls -l tstsql
-rwxr-xr-x 1 jrs jrs 35797 2011-08-29 02:54 tstsql

Compiling your scripts offers some distinct advantages over the scriba command line interpreter wrapper of the SBAPI.

  • Pre-compiled (tokenized) script
  • Shared object runtime
  • Static linking of extension modules rather than the default dynamic linking if desired

If you don't want to go through the trouble of converting the script to C and compiling with gcc, you can use the scriba command line option to create a standalone executable. This method attaches a tokenized (binay) version of the script to the end of a copy of scriba. Scriba always checks to see if there is a binary script attached before running the script name passed on the command line.

/usr/bin/scriba -Eo tstsql testmysql.sb



85
GSL / GNU Scientific Library (GSL)
« on: May 29, 2011, 09:09:12 PM »
I have finished the Elementary Functions portion of the ScriptBasic extension module for the GSL library.

Code: [Select]
/*
   GNU Scientific Library
   Based on GSL 1.15
   Interface By: John Spikowski
   Refinements By: Armando I. Rivera (AIR)
   Version 0.01
*/

#include <stdio.h>
#include "../../basext.h"
#include <gsl/gsl_math.h>
     
besVERSION_NEGOTIATE
    return (int)INTERFACE_VERSION;
besEND

besSUB_START

besEND

besSUB_FINISH

besEND

/* Elementary Functions */

besFUNCTION(_log1p)
  double x;

  besARGUMENTS("r")
    &x
  besARGEND 

  besRETURN_DOUBLE(gsl_log1p(x));
besEND


besFUNCTION(_expm1)
  double x;

  besARGUMENTS("r")
    &x
  besARGEND 

  besRETURN_DOUBLE(gsl_expm1(x));
besEND


besFUNCTION(_hypot)
  double x,y;

  besARGUMENTS("rr")
    &x,&y
  besARGEND 

  besRETURN_DOUBLE(gsl_hypot(x, y));
besEND


besFUNCTION(_hypot3)
  double x,y,z;
 
  besARGUMENTS("rrr")
    &x,&y,&z
  besARGEND 

  besRETURN_DOUBLE(gsl_hypot3(x, y, z));
besEND


besFUNCTION(_acosh)
  double x;

  besARGUMENTS("r")
    &x
  besARGEND 

  besRETURN_DOUBLE(gsl_acosh(x));
besEND


besFUNCTION(_asinh)
  double x;

  besARGUMENTS("r")
    &x
  besARGEND 

  besRETURN_DOUBLE(gsl_asinh(x));
besEND


besFUNCTION(_atanh)
  double x;

  besARGUMENTS("r")
    &x
  besARGEND 

  besRETURN_DOUBLE(gsl_atanh(x));
besEND


besFUNCTION(_ldexp)
  double x;
  int y;

  besARGUMENTS("ri")
    &x,&y
  besARGEND 

  besRETURN_DOUBLE(gsl_ldexp(x, y));
besEND


besFUNCTION(_frexp)
  double f;
  LEFTVALUE e;

  besARGUMENTS("r")
    &f
  besARGEND
  besLEFTVALUE(besARGUMENT(2),e);
 
  besRETURN_DOUBLE(gsl_frexp(f, *e));
besEND

Calling GSL SB extension module functions:

log1p()

Code: [Select]
DECLARE SUB log1p ALIAS "_log1p" LIB "gsl"

PRINT FORMAT("%.32g", log1p(34.0)),"\n"

3.5553480614894135136694330867613

frexp()

Code: [Select]
DECLARE SUB frexp ALIAS "_frexp" LIB "gsl"

x = 16.4
e = 0
fraction = frexp(x, e)

PRINT FORMAT("%g",fraction),"\n"
PRINT e,"\n"

0.5125
5

86
mxml / ScriptBasic Mini-XML Extension Module
« on: April 10, 2011, 05:45:16 PM »
Mini-XML is a small XML library that you can use to read and write XML and XML-like data files in your application without requiring large non-standard libraries.

Armando created the mxml extension module as a replacement for the GNOME libxml2 extension module that was introduced with the 2.0 release by Peter Verhas but never fully tested or documented.

Code: [Select]
include mxml.bas

filename = "stuff.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)

Code: Text
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <stufflist>
  3.         <stuff_test>This is a test!</stuff_test>
  4.         <stuff_test2>And this is another test!</stuff_test2>
  5.         <stuff_test3>
  6.                 <painting>
  7.                         <img src="madonna.jpg" alt='Foligno Madonna, by Raphael'/>
  8.                         <caption>This is Raphael's "Foligno" Madonna, painted in
  9.                                 <date>1511</date>.
  10.                         </caption>
  11.                 </painting>
  12.         </stuff_test3>
  13.         <books>
  14.     <book>
  15.         <id>1</id>
  16.         <name>Hello, world!</name>
  17.     </book>
  18.     <book>
  19.         <id>2</id>
  20.         <name>Hello, China!</name>
  21.     </book>
  22.         </books>
  23. </stufflist>
  24.  

jrs@Laptop:~/SB/test$ scriba mxmltest.sb
Test1: This is a test!
Test2: And this is another test!

Image: madonna.jpg
Alt Image: Foligno Madonna, by Raphael

ID = 1
Name = Hello, world!
ID = 2
Name = Hello, China!
jrs@Laptop:~/SB/test$


The attached mxml_i386.tar.gz is for 32 bit versions of Linux.

87
What's New / ScriptBasic Hash Extension Module Fix
« on: April 10, 2011, 11:20:44 AM »
Armando fixed an age old issue with the hash extension module (memory error) and I tested it on both 32 and 64 bit Ubuntu.

Armando's test program
Code: [Select]
import hash.bas

h = hash::New()

for i=1 to 10
hash::SetValue h,"q"&i,i
next i

hash::Start h
while hash::Exists(h)
 print hash::ThisKey(h)," ", hash::ThisValue(h)
 print
 hash::Next h
wend

hash::Release h

jrs@Laptop:~/SB/test$ scriba hash.air
q1 1
q2 2
q3 3
q4 4
q5 5
q6 6
q7 7
q8 8
q9 9
q10 10
jrs@Laptop:~/SB/test$

88
What's New / ScriptBasic 32 Bit Linux
« on: April 09, 2011, 12:50:22 PM »
Armando and I used the ScriptBasic source we built the 64 bit version for to build a 32 bit version for Ubuntu 10.10.

sudo gdebi scriba-v2.1.1_i386.deb  -  Install

sudo apt-get remove scriba  -  Remove


Code: [Select]
jrs@Laptop:~/SB/scriptbasic$ sudo ./mkdeb.sh
The configuration file 'deb/scriba/etc/scriba/basic.conf' was created.
dpkg-deb: building package `scriba' in `scriba.deb'.
jrs@Laptop:~/SB/scriptbasic$ cd deb
jrs@Laptop:~/SB/scriptbasic/deb$ ls -l
total 812
drwxr-xr-x 2 jrs  jrs    4096 2011-04-09 12:20 DEBIAN
-rwxr-xr-x 1 jrs  jrs    5178 2011-04-08 13:39 deblist.txt
drwxr-xr-x 6 root root   4096 2011-04-09 12:21 scriba
-rw-r--r-- 1 root root 812402 2011-04-09 12:22 scriba-v2.1.1_i386.deb
jrs@Laptop:~/SB/scriptbasic/deb$ dpkg -c scriba-v2*
drwxr-xr-x root/root         0 2011-04-09 12:21 ./
drwxr-xr-x root/root         0 2011-04-09 12:21 ./usr/
drwxr-xr-x root/root         0 2011-04-09 12:21 ./usr/bin/
-rwxr-xr-x root/root    529394 2011-04-09 12:21 ./usr/bin/sbhttpd
-rwxr-xr-x root/root    507943 2011-04-09 12:21 ./usr/bin/scriba
drwxr-xr-x root/root         0 2011-04-09 12:21 ./usr/share/
drwxr-xr-x root/root         0 2011-04-09 12:21 ./usr/share/scriba/
drwxr-xr-x root/root         0 2011-04-09 12:21 ./usr/share/scriba/include/
-rwxr-xr-x root/root      1748 2011-04-09 12:21 ./usr/share/scriba/include/mysql.bas
-rwxr-xr-x root/root       600 2011-04-09 12:21 ./usr/share/scriba/include/time.bas
-rwxr-xr-x root/root       962 2011-04-09 12:21 ./usr/share/scriba/include/t.bas
-rwxr-xr-x root/root       336 2011-04-09 12:21 ./usr/share/scriba/include/dyc.bas
-rwxr-xr-x root/root      8331 2011-04-09 12:21 ./usr/share/scriba/include/error.bas
-rwxr-xr-x root/root      2133 2011-04-09 12:21 ./usr/share/scriba/include/hash.bas
-rwxr-xr-x root/root      1654 2011-04-09 12:21 ./usr/share/scriba/include/xml.bas
-rwxr-xr-x root/root       604 2011-04-09 12:21 ./usr/share/scriba/include/odbc.bas
-rwxr-xr-x root/root     10296 2011-04-09 12:21 ./usr/share/scriba/include/modinst.bas
-rwxr-xr-x root/root       748 2011-04-09 12:21 ./usr/share/scriba/include/curl.bas
-rwxr-xr-x root/root      1031 2011-04-09 12:21 ./usr/share/scriba/include/zlib.bas
-rwxr-xr-x root/root      1661 2011-04-09 12:21 ./usr/share/scriba/include/cio.bas
-rwxr-xr-x root/root       246 2011-04-09 12:21 ./usr/share/scriba/include/trial.bas
-rwxr-xr-x root/root      1201 2011-04-09 12:21 ./usr/share/scriba/include/mt.bas
-rwxr-xr-x root/root      5438 2011-04-09 12:21 ./usr/share/scriba/include/cgi.bas
-rwxr-xr-x root/root      2349 2011-04-09 12:21 ./usr/share/scriba/include/gd.bas
-rwxr-xr-x root/root      6577 2011-04-09 12:21 ./usr/share/scriba/include/curses.bas
-rwxr-xr-x root/root       578 2011-04-09 12:21 ./usr/share/scriba/include/ux.bas
-rwxr-xr-x root/root       709 2011-04-09 12:21 ./usr/share/scriba/include/sdbg.bas
-rwxr-xr-x root/root       709 2011-04-09 12:21 ./usr/share/scriba/include/dbg.bas
-rwxr-xr-x root/root      2180 2011-04-09 12:21 ./usr/share/scriba/include/re.bas
drwxr-xr-x root/root         0 2011-04-09 12:21 ./usr/share/scriba/source/
-rwxr-xr-x root/root      1728 2011-04-09 12:21 ./usr/share/scriba/source/heber.bas
drwxr-xr-x root/root         0 2011-04-09 12:21 ./usr/local/
drwxr-xr-x root/root         0 2011-04-09 12:21 ./usr/local/lib/
-rwxr-xr-x root/root      8344 2011-04-09 12:21 ./usr/local/lib/zlib.a
-rwxr-xr-x root/root      1656 2011-04-09 12:21 ./usr/local/lib/ux.a
-rwxr-xr-x root/root     42566 2011-04-09 12:21 ./usr/local/lib/cgi.a
-rwxr-xr-x root/root     18744 2011-04-09 12:21 ./usr/local/lib/sdbg.a
-rwxr-xr-x root/root     21464 2011-04-09 12:21 ./usr/local/lib/gd.a
-rwxr-xr-x root/root      7166 2011-04-09 12:21 ./usr/local/lib/xml.a
-rwxr-xr-x root/root     17048 2011-04-09 12:21 ./usr/local/lib/dbg.a
-rwxr-xr-x root/root    670486 2011-04-09 12:21 ./usr/local/lib/lscriba.a
-rwxr-xr-x root/root     17784 2011-04-09 12:21 ./usr/local/lib/mysql.a
-rwxr-xr-x root/root     20694 2011-04-09 12:21 ./usr/local/lib/mt.a
-rwxr-xr-x root/root      9692 2011-04-09 12:21 ./usr/local/lib/t.a
-rwxr-xr-x root/root      5216 2011-04-09 12:21 ./usr/local/lib/trial.a
-rwxr-xr-x root/root    673194 2011-04-09 12:21 ./usr/local/lib/libscriba.a
-rwxr-xr-x root/root     42636 2011-04-09 12:21 ./usr/local/lib/curl.a
-rwxr-xr-x root/root      9320 2011-04-09 12:21 ./usr/local/lib/hash.a
-rwxr-xr-x root/root     11228 2011-04-09 12:21 ./usr/local/lib/odbc.a
-rwxr-xr-x root/root     53062 2011-04-09 12:21 ./usr/local/lib/re.a
drwxr-xr-x root/root         0 2011-04-09 12:21 ./usr/local/lib/scriba/
-rwxr-xr-x root/root     12790 2011-04-09 12:21 ./usr/local/lib/scriba/odbc.so
-rwxr-xr-x root/root      9345 2011-04-09 12:21 ./usr/local/lib/scriba/xml.so
-rwxr-xr-x root/root     14654 2011-04-09 12:21 ./usr/local/lib/scriba/curses.so
-rwxr-xr-x root/root     50207 2011-04-09 12:21 ./usr/local/lib/scriba/re.so
-rwxr-xr-x root/root     21290 2011-04-09 12:21 ./usr/local/lib/scriba/mysql.so
-rwxr-xr-x root/root     17075 2011-04-09 12:21 ./usr/local/lib/scriba/dbg.so
-rwxr-xr-x root/root     10711 2011-04-09 12:21 ./usr/local/lib/scriba/t.so
-rwxr-xr-x root/root     10284 2011-04-09 12:21 ./usr/local/lib/scriba/hash.so
-rwxr-xr-x root/root     22397 2011-04-09 12:21 ./usr/local/lib/scriba/mt.so
-rwxr-xr-x root/root     18980 2011-04-09 12:21 ./usr/local/lib/scriba/sdbg.so
-rwxr-xr-x root/root     43771 2011-04-09 12:21 ./usr/local/lib/scriba/cgi.so
-rwxr-xr-x root/root     45595 2011-04-09 12:21 ./usr/local/lib/scriba/curl.so
-rwxr-xr-x root/root     30802 2011-04-09 12:21 ./usr/local/lib/scriba/psql.so
-rwxr-xr-x root/root      6232 2011-04-09 12:21 ./usr/local/lib/scriba/trial.so
-rwxr-xr-x root/root     10001 2011-04-09 12:21 ./usr/local/lib/scriba/zlib.so
-rwxr-xr-x root/root      2320 2011-04-09 12:21 ./usr/local/lib/scriba/ux.so
-rwxr-xr-x root/root     11916 2011-04-09 12:21 ./usr/local/lib/curses.a
-rwxr-xr-x root/root     27628 2011-04-09 12:21 ./usr/local/lib/psql.a
drwxr-xr-x root/root         0 2011-04-09 12:21 ./etc/
drwxr-xr-x root/root         0 2011-04-09 12:21 ./etc/init.d/
drwxr-xr-x root/root         0 2011-04-09 12:21 ./etc/scriba/
-rwxr-xr-x root/root      1775 2011-04-09 12:21 ./etc/scriba/basic.conf
drwxrwxrwx root/root         0 2011-04-09 12:21 ./.scriba/
drwxrwxrwx root/root         0 2011-04-09 12:21 ./.scriba/hebtemp/
drwxrwxrwx root/root         0 2011-04-09 12:21 ./.scriba/cache/
jrs@Laptop:~/SB/scriptbasic/deb$ ls -l
total 812
drwxr-xr-x 2 jrs  jrs    4096 2011-04-09 12:20 DEBIAN
-rwxr-xr-x 1 jrs  jrs    5178 2011-04-08 13:39 deblist.txt
drwxr-xr-x 6 root root   4096 2011-04-09 12:21 scriba
-rw-r--r-- 1 root root 812402 2011-04-09 12:22 scriba-v2.1.1_i386.deb
jrs@Laptop:~/SB/scriptbasic/deb$ sudo gdebi scriba-v2.1.1_i386.deb
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Building data structures... Done
Building data structures... Done


ScriptBasic Embeddable Interpreter
Do you want to install the software package? [y/N]:y
Selecting previously deselected package scriba.
(Reading database ... 447312 files and directories currently installed.)
Unpacking scriba (from scriba-v2.1.1_i386.deb) ...
Setting up scriba (2.1.1) ...
Processing triggers for ureadahead ...
ureadahead will be reprofiled on next reboot

jrs@Laptop:~/SB/scriptbasic/deb$

89
Download / ScriptBasic 64 Bit Linux
« on: April 08, 2011, 09:09:13 PM »
Armando and I were able to build a version of ScriptBasic for Ubuntu 10.10 64 bit.

This version of ScriptBasic includes the additional math functions Tom contributed.

This package will install ScriptBasic's dependencies if they are not present.

sudo gdebi scriba-v2.1.1_amd64.deb  -  Install

sudo apt-get remove scriba  -  Remove

Here is the ScriptBasic source directory I used to build the runtime and install .deb file.

scriba-v2.1.1-src_amd64.tar.z

ScriptBasic Online Documentation


ScriptBasic 64 is a powerful scripting language/API that is easy to use and takes less code to get the job done.

Large Numbers

Code: [Select]
a = 9000000000000000000 / 2
PRINT a,"\n"

$ scriba biglong.sb
4500000000000000000

New Math Functions

Code: [Select]
The following 8 functions accept radians as their argument, so we use the
new RAD() function to convert 34 degrees to 5.934119e-01 (0.593412) radians.

Tangent Cotangent Secant Cosecant
TAN()   COTAN()   SECANT()     COSECANT()
6.745085e-01 1.482561e+00 1.206218e+00 1.788292e+00
0.674509 1.482561 1.206218 1.788292

Arctangent Arccotangent Arcsecant Arccosecant
ATAN()     ACTAN()   ASECANT() ACOSECANT()
5.934119e-01 5.934119e-01 5.934119e-01 5.934119e-01
0.593412 0.593412 0.593412 0.593412

There are 6 Hyperbolic functions. They also accept radian arguments.

H-Sine H-Cosine H-Tangent
HSIN() HCOS()   HTAN()
6.288574e-01 1.181297e+00 5.323451e-01
0.628857 1.181297 0.532345

H-Secant H-Cosecant H-Cotangent
HSECANT() HCOSECANT() HCTAN()
8.465274e-01 1.590186e+00 1.878481e+00
0.846527 1.590186 1.878481


Large Strings

Code: [Select]
a = string(100000000," ") & "John" & string(100000000," ")
PRINT INSTR(a,"John"),"\n"

$ scriba biginstr.sb
100000001

Easy Database Access

sbdb:test


Code: [Select]
' MySQL Test Program

INCLUDE mysql.bas

dbh = mysql::RealConnect("localhost","USER","PSWD","sbdb")

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

WHILE mysql::FetchHash(dbh,column)

PRINTNL
PRINT column{"ID"},"\n"
PRINT column{"NAME"},"\n"
PRINTNL

WEND

PRINTNL
PRINT "The database handle is: ",dbh,"\n"
PRINT "Affected rows by SELECT: ",mysql::AffectedRows(dbh),"\n"
PRINT "Character set name is: ",mysql::CharacterSetName(dbh),"\n"
PRINT "Last error is: ",mysql::ErrorMessage(dbh),"\n"
PRINT "Client info is: ",mysql::GetClientInfo(),"\n"
PRINT "Host info is: ",mysql::GetHostInfo(dbh),"\n"
PRINT "Proto info is: ",mysql::GetProtoInfo(dbh),"\n"
PRINT "Server info is: ",mysql::GetServerInfo(dbh),"\n"
PRINT "PING result: ",mysql::Ping(dbh),"\n"
PRINT "Thread ID: ",mysql::ThreadId(dbh),"\n"
PRINT "Status is: ",mysql::Stat(dbh),"\n"

mysql::Close(dbh)

END

$ scriba testmysql.sb
1
John Spikowski

The database handle is: 1
Affected rows by SELECT: 1
Character set name is: latin1
Last error is:
Client info is: 5.1.49
Host info is: Localhost via UNIX socket
Proto info is: 10
Server info is: 5.1.49-1ubuntu8.1
PING result: -1
Thread ID: 0
Status is: Uptime: 194893  Threads: 1  Questions: 2043  Slow queries: 0  Opens: 200  Flush tables: 1  Open tables: 64  Queries per second avg: 0.10

Network/Internet Access

This cURL extension module example downloads the ScriptBasic logo from it's project site.

Code: [Select]
IMPORT curl.bas

ch = curl::init()
curl::option(ch,"URL","http://scriptbasic.org/logo.png")
curl::option(ch,"FILE","sb_logo.png")
curl::perform(ch)
curl::finish(ch)

If programming for the web is your thing, ScriptBasic includes a multi-threaded application proxy server to run your GCI scripts with in memory session support with enhanced security safeguards. (files located outside of web root, .htaccess authorization caching, connection pooling with ODBC, real {binary format} programs and not embedded parsed HTML text scripts like php)

Feedback appreciated!




90
What's New / ScriptBasic 64 Bit Linux
« on: March 31, 2011, 12:40:12 AM »
I wrote a webservice application using ScriptBasic on a Ubuntu 10.10 32 bit system recently. As it turned out the application needed to run on a 64 bit version of Ubuntu. Armando had compiled 64 bit versions of ScriptBasic for OSX and Windows. (MinGWGCC-IDM) For some reason we never got around to doing a 64 bit version for Linux. The good news is that ScriptBasic runs fine in 64 bit mode on Linux. (thanks to Armando's assistance) When I find some spare time, I would like to add a setup --gcc64 option to add the needed compiler switches to the make files being generated to create 64 bit executables and libraries.


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