Raspberry BASIC

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 - John Spikowski

Pages: 1 2 [3]
31
ScriptBasic / Remote Console Debugger
« on: April 16, 2019, 05:10:03 pm »
This is an example of debugging a script with the console mode interactive debugger.

dbgcontest.sb
Code: Script BASIC
  1. a = 1
  2. b = "ScriptBasic"
  3. PRINT a,"\n"
  4. PRINT b,"\n"
  5.  


pi@raspberrypi:~/sbrpi $ scriba dbgcon.sb dbgcontest.sb
Application: ScriptBasic Remote Debugger
Version: 1.0
Source-File-Count: 1
Source-File: dbgcontest.sb
Current-Line: 1
-> l 1-
 [0001] a = 1
 [0002] b = "ScriptBasic"
 [0003] PRINT a,"\n"
 [0004] PRINT b,"\n"
Current-Line: 1
-> s
Current-Line: 2
-> b4
Message: done
Current-Line: 2
-> r
1
Current-Line: 4
-> G
Global-Variable-Name: main::a
Global-Variable-Value: 1
Global-Variable-Name: main::b
Global-Variable-Value: "ScriptBasic"
Current-Line: 4
-> r
ScriptBasic
Debug session closed.
pi@raspberrypi:~/sbrpi $


Place the sdbg.so in your /usr/local/lib/scriba directory.
The dbgcon.sb script should be in the same directory as the script you're debugging.

32
ScriptBasic / Working with cURL
« on: April 15, 2019, 05:06:58 am »
This thread will be about using ScriptBasic and the cURL extension module. The first example is what I call my Hello Me cURL example. This is also included in the extension module test scripts I posted in the Resources thread.

Code: Script BASIC
  1. ' MyIP
  2.  
  3. IMPORT curl.bas
  4.  
  5. ch = curl::init()
  6. curl::option(ch,"URL","ipinfo.io")
  7. PRINT curl::perform(ch),"\n"
  8.  
  9. curl::finish(ch)
  10.  

Output

pi@RPi3B:~/sbrpi/examples $ time scriba myip.sb
{
  "ip": "#4.#9.#1.#11",
  "hostname": "c-#4-#9-#1-#11.hsd1.wa.comcast.net",
  "city": "Anacortes",
  "region": "Washington",
  "country": "US",
  "loc": "48.5004,-122.6310",
  "postal": "98221",
  "org": "AS33650 Comcast Cable Communications, LLC"
}

real   0m0.334s
user   0m0.049s
sys   0m0.016s
pi@RPi3B:~/sbrpi/examples $



33
BBC BASIC / BBC BASIC Compiler?
« on: April 15, 2019, 03:33:17 am »
Richard,

Quote from: Your Web Site
The Raspberry Pi edition has an ARM assembler.

This was the reason I thought BBC BASIC was a BASIC to ASM compiler.


34
ScriptBasic / Resources
« on: April 15, 2019, 02:07:05 am »
The following resources are available for the Raspberry Pi.

ScriptBasic Runtime - RPi Zero (this version runs on all models of the Raspberry Pi)
https://raspberrybasic.org/download/scriptbasic-rpi-zero.deb

ScriptBasic Runtime - Rpi ARMv7 (B / B+ Doesn't run on the Zero)
https://raspberrybasic.org/download/scriptbasic-2.1-linux-armhf.deb

ScriptBasic Runtime - AppImage (ARMv7 single file no install)
https://raspberrybasic.org/download/sb.AppImage.zip

DEB Install (installs needed dependences as well)
sudo apt install ./scriptbasic-2.1-linux-armhf.deb

AppImage
Extract the sb file from the zip in a directory in the system path.

Note: The DEB installs use scriba to run scripts and the AppImage uses sb to run them.

The source can be found in the AllBASIC sandbox.
https://sandbox.allbasic.info:8181/scriptbasic/sb-dev

Extract your source download whch will create a sb-dev directory. Make sure you install the developer dependencies for the extension modules.

libcurl4-gnutls-dev
libiodbc2-dev
libmariadbclient-dev-compat (provides mysqlclient)
libncurses5-dev
libsqlite3-dev
libssl-dev
zlib1g-dev

sudo perl jamal.pl -i    (this adds a Perl module the ScriptBasic build system needs but normally not installed by default)

./setup   (this builds the ScriptBasic runtime executables and include files created in the bin directory.

If all goes well, run the mkdeb.sh script to create the PACKAGES .deb install file or create a local install using mkdist.sh <dest dir>.


Documentation (User and Developer) can be found in the ScriptBasic Wiki.
https://scriptbasic.org/wiki

Feel free to send me a PM (Private Message) or post your questions to the ScriptBasic forum board.

Attached is a set of scripts and data files I use to test the extension modules with.

Additional Extension Modules

GPM Fibo
Extract the zip and put the gmp.so extension module that should go in the /usr/local/lib/scriba directory.

https://raspberrybasic.org/download/gmp_zero.zip


TinyScheme
* Unzip to a tmp directory.
* Copy libtinyscheme.so to your /usr/lib/ directory.
* Copy ts.so to your /usr/local/lib/scriba/ directory.
* Copy the remaining examples and init.scm to your ScriptBasic examples directory where ever that may be.

Note: The init.scm file is a Lisp script that adds additional syntax to your Lisp scripts.

https://raspberrybasic.org/download/TinyScheme_RPi_Zero.zip

35
ScriptBasic / ScriptBasic Introduction
« on: April 09, 2019, 07:16:57 pm »


Script BASIC is written in ANSI C with an object like API. The scripting engine is embeddable, with a thread safe memory manager and virtually unlimited expandability. The core language uses one source tree for all platforms. Variables are maintained in a variant like structure and typeless until used.

Script BASIC comes with an array of industry standard library extension modules and a multi-threaded proxy HTTPD application server running as an OS service.

Scripting doesn't get any easier and based on a language syntax we all grew up with.

ScriptBasic Forum


Pages: 1 2 [3]