Author Topic: ScriptBasic 2.2 pre-release runtime downloads (Windows/Linux)  (Read 21120 times)

Support

  • Administrator
  • *****
  • Posts: 22
    • View Profile
ScriptBasic 2.2 pre-release runtime downloads (Windows/Linux)
« on: September 23, 2013, 11:46:01 AM »
There seems to be some confusion where to get the latest ScriptBasic 2.2 pre-release candidates for Windows and Linux so I created this sticky in the downloads section and will keep it updated as we come closer to an official release. (which will include source and documentation) Most of the work done for the 2.2 release is in the form of extension modules contributed by Armando I. Rivera (AIR) and updating 3rd party libraries to current levels. Another goal with the 2.2 release is to create both 32 and 64 bit versions of ScriptBasic for both Windows and Linux. (popular distributions) As a bonus I hope to have something for Android Linux with a SDL & JNI option. (stay tuned for announcements)

I'm confident that ScriptBasic core continues to be rock solid. The goal with this pre-release is to shake out any issues with the extensions modules and their updated library interfaces. I'm working hard on wrapping up the IUP extension module and working with Charles on DLLC.

Note: The www.scriptbasic.com site is not the open source project site and is Peter Verhas's (author) static snapshot of where he left of with the project. Using code from that site is ancient and more than likely not going to work on current versions of the OS. The Windows 2.00b version may still work.
« Last Edit: September 23, 2013, 11:54:15 AM by support »

Support

  • Administrator
  • *****
  • Posts: 22
    • View Profile
Re: ScriptBasic 2.2 pre-release runtime downloads (Windows/Linux)
« Reply #1 on: October 13, 2013, 09:04:57 PM »
I found my first ScriptBasic bug after managing the project since 2006. It even surprised Peter that no one discovered it before. The fix was easy and based on the reminder / warning comment in the old version of the code Peter left, it was something I think he had plans to come back to. I was going to include this fix as part of the next ScriptBasic 2.2 Build 2 release candidate but the fix was needed now for the BAS2NIM project as it will use LIKE/JOKER extensively.

Quote from: Peter Verhas
Matching with jokers has a serious flaw in the core ScriptBasic. To fix that the file commands/string.c has to be modified.

Code: [Select]
$ diff commands/string.c ../commands/string.c
2329a2330
>
2331,2337c2332,2335
<     }else{
<     /* If the array is long enough then delete the previous result otherwise
<        fake data may remain in it and it may cause trouble. */
<     for( i=0 ; i < pLastResult->cArraySize ; i++ ){
<       pLastResult->pcbParameterArray[i] = 0;
<       pLastResult->ParameterArray[i] = NULL;
<       }
---
>     }
>   for( i=0 ; i < pLastResult->cArraySize ; i++ ){
>     pLastResult->pcbParameterArray[i] = 0;
>     pLastResult->ParameterArray[i] = NULL;

It is simply removing the "else" from the code and this way the ParameterArray variables always get NULLified.

This code originally assumed that even if there is some garbage in this array that will never be accessed, because the algorithm calculates the number of joker characters in the pattern and if any JOKER(N) call is made with a large N then it fill return undef by default, because the code recognized the over indexing.

However in the example above there are special joker characters, namely <, > and / that are configured not to be joker characters by default and they are also not activated using the SET JOKER command. They are calculated and the code comes to the conclusion that there are 6 joker characters. In reality there are only two when the matching is done and the array indexes from 2 to 5 remain garbage, but still accessible. Setting them explicitly NULL before the matching takes place will force them to be undef. Although this "undef" is not because of over indexing in the C level code there is no difference on the BASIC level.

--
Dipl. Ing. Peter Verhas
 
« Last Edit: October 14, 2013, 12:14:23 PM by support »

Support

  • Administrator
  • *****
  • Posts: 22
    • View Profile
Re: ScriptBasic 2.2 pre-release runtime downloads (Windows/Linux)
« Reply #2 on: March 07, 2014, 11:11:03 AM »
ScriptBasic Pre-Release Install Instructions

I hope to have a fully automated installation script when the ScriptBasic 2.2 version is release. Until then, here is a guide to help you get ScriptBasic installed with extension module support. I will start off with the minimal requirements and touch on some of the more advanced configuration options as time permits.

ScriptBasic User Guide

ScriptBasic Developer Guide

ScriptBasic Configuration Guide

Bare Bones

The command line interpreter scriba(.exe) can run scripts without the need of a configuration file. If the script is in the same directory as scriba then do the following.

Code: [Select]
./scriba yourscript     <--- Linux

scriba yourscript       <-- Windows

The first thing that should be done is add the search path to the ScriptBasic bin directory/. This will allow scriba to run from anywhere. For this tutorial I will assume that you unzipped the SB 2.2 pre-release in the C:\scriptbasic or /home/me/scriptbasic directory. Under Windows you can edit the search path by going to control panel -> system -> advanced -> edit PATH.  In Linux you can add the SB search path with the following. This can also be added to your login profile along with the other exports that will be discussed in this tutorial.

Code: [Select]
export PATH=$PATH:/home/me/scriptbasic/bin

The next step is to create a minimal ScriptBasic SCRIBA.INI (binary format) configuration file for Windows installs. You need to use the admin console for this step to create the SCRIBA.INI in the WINDOWS system directory.

Under Linux, set the SCRIBACONF environmental variable to point to where the basic.con file is located. This minimal configuration file will only indicate the type of shared object being used and the paths to the ScriptBasic include and modules directory.  Using a text editor, create a file basic.conf.txt in your SB bin directory with the following information.

Linux
Code: [Select]
dll ".so"
module "/home/me/scriptbasic/modules/"
include "/home/me/scriptbasic/include/"

Windows
Code: [Select]
dll ".dll"
module "C:/scriptbasic/modules/"
include "C:/scriptbasic/include/"

For Linux lets setup the SCRIBACONF environmental variable to point where the ScriptBasic configuration file resides.

Code: [Select]
export SCRIBACONF=/home/me/scriptbasic/bin/basic.conf


From within your ScriptBasic bin directory and where you created your basic.conf.txt file, do the following to create the binary version basic.conf file. We are ready to generate the binary basic.conf which will be created in the path specified above. If the the SCRIBACONF variable isn't set, under Linux the file is created in the /etc/scriba/ and on Windows, SCRIBA.INI is created in the the system WINDOWS directory.

Code: [Select]
scriba -k basic.conf.txt

You now have a minimal ScriptBasic install that will allow you to use the IMPORT for extension modules without having to give a full path. I will continue to append to this tutorial showing some of the more advanced configuration options as I have time. This should get you going and allow you to contribute to the ScriptBasic project.


« Last Edit: March 17, 2014, 02:25:40 PM by support »