Author Topic: ScriptBasic 3.0 Open Items  (Read 36856 times)

mesbas

  • Guest
Re: ScriptBasic 3.0 Open Items
« Reply #15 on: January 08, 2011, 07:02:07 AM »
Code: [Select]
[root@kahuna scriptbasic]# scriba -v
ScriptBasic v2.1
Variation >>STANDARD<< build 1
Magic value 859002423
Node size is 24
Extension interface version is 11
Compilation: Jan  7 2011 10:27:07

Notice the Node size is 24 vs. 16 on your machine.
I'm not sure what that means.

The only other thing different is the compiler flags.
The first few lines of my Makefile are:

Code: [Select]
.PHONY: all

LD_FLAGS = -shared
EXTRA_CFLAGS = -fPIC

I use -fPIC because Fedora uses the ELF system.
I get a linker error without it.

First make sure that syntaxer.pl worked properly.

Code: [Select]
grep RAD *.cfrom the scriptbuilder directory.

You should find RAD in notimp.c and syntax.c
If that appears OK, then....

My suggestion would be to put the 4 files back to normal, then do
the make clean and make again.
If that works then a more intense investigation will follow.

Support

  • Administrator
  • *****
  • Posts: 22
    • View Profile
Re: ScriptBasic 3.0 Open Items
« Reply #16 on: January 08, 2011, 10:59:38 AM »
Code: [Select]
root@Laptop:/usr/src/scriptbasic# grep RAD *.c
errcodes.c:#define LEX_ERROR_BAD_RADIX 76
lexer.c:        if( intpart < 2 || intpart > 36 )return LEX_ERROR_BAD_RADIX;
notimp.c:#define NOTIMP_RAD 0
syntax.c:#define CMD_RAD 487
syntax.c:void COMMAND_RAD(pExecuteObject);
syntax.c:{ CMD_RAD , 1 , 1}, /*rad*/
syntax.c:#define KEYWORDCODE_RAD CMD_RAD
syntax.c:{ "rad" , CMD_RAD } ,
syntax.c:{ "RAD" , CMD_RAD } , /* 487 */
syntax.c:  COMMAND_RAD, /* 487 */
syntax.c:         "RAD", /* 487 */
root@Laptop:/usr/src/scriptbasic#

I tried a ./setup and it worked with your code.

Code: [Select]
jrs@Laptop:~/SB/test$ scriba MathTest.bas

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

jrs@Laptop:~/SB/test$

I always use ./setup as there is so much going on building the system from scratch. I only compile extension modules with make in the extension module sub-directory if I'm having problems and don't want to recompile anything else. Glad it works!

« Last Edit: January 08, 2011, 11:41:11 AM by support »

Support

  • Administrator
  • *****
  • Posts: 22
    • View Profile
Re: ScriptBasic 3.0 Open Items
« Reply #17 on: January 08, 2011, 01:36:53 PM »
Tom,

Even though I was able to run your MathTest.bas script with the additional math functions added, I'm getting segment faults with other scripts and strange syntax errors on program load. Something still isn't right. If the program loads an extension module, I see the segmentation errors and strange load error messages.

John
« Last Edit: January 08, 2011, 02:08:00 PM by support »

mesbas

  • Guest
Re: ScriptBasic 3.0 Open Items
« Reply #18 on: January 08, 2011, 02:59:09 PM »
John,

Just so were on the same page.

I downloaded SB_2.1_RC1_Linux.tar.gz from the website.
I then gunzip'd it and ran tar xvf SB_2.1_RC1_Linux.tar

The scriptbasic directory was created.

I copied notimp.h, syntax.h and syntax.def into the scriptbasic directory.
I then copied mathfunc.c into the scriptbasic/commands directory.

From the scriptbasic directory, I did the following:
Code: [Select]
chmod +x convert.sh setup
./convert.sh
perl syntaxer.pl
./setup
make clean
make
./setup --install
./install

You may not want to do the ./install, but scriba will be in the bin/exe directory.

I've done this several times today, and it works without problems.
Send me one of the .bas apps that don't work.
I'll see if it works on my side.

Support

  • Administrator
  • *****
  • Posts: 22
    • View Profile
Re: ScriptBasic 3.0 Open Items
« Reply #19 on: January 08, 2011, 03:10:19 PM »
Tom,

The first script I tried after running your MathTest.bas program was a test of using my tinyXML parser on a HTML file to see if it would extract the text and remove the HTML tags. I got a segment fault when trying to run it. Here is a post I made on the ThinBasic forum about using it. (used my original version of scriba to make it work)

Code: [Select]
IMPORT t.bas

xml = t::LoadString("test.html")

SPLITA xml BY ">" TO a

FOR x = 0 TO UBOUND(a)
  IF LEFT(TRIM(a[x]),1) = "<" THEN GOTO IT
  p = INSTR(a[x],"<")
  PRINT MID(a[x],p+2) & " = " & LEFT(a[x],p-1),"\n"
IT:
NEXT

« Last Edit: January 08, 2011, 05:17:48 PM by support »

mesbas

  • Guest
Re: ScriptBasic 3.0 Open Items
« Reply #20 on: January 08, 2011, 06:38:09 PM »
Sorry! I can't see if it works on my machine.
I don't have the IMPORTED t.bas file.

Support

  • Administrator
  • *****
  • Posts: 22
    • View Profile
Re: ScriptBasic 3.0 Open Items
« Reply #21 on: January 08, 2011, 07:13:27 PM »
t.bas / t.so is a ScriptBasic extension module that comes with the distribution. It has always compiled in the past (all OS's). Did you setup your basic.conf yet and point where the the INCLUDE and MODULE directories are?


mesbas

  • Guest
Re: ScriptBasic 3.0 Open Items
« Reply #22 on: January 09, 2011, 08:52:45 AM »
Yes, basic.conf was setup properly and installed.

I blew away everything and re-installed the default scriptbasic 2.1
Of course my MathTest.bas fails.
Code: [Select]
[root@kahuna TestApps]# scriba MathTest.bas
Status: 200 OK
Content-Type: text/html

<HTML><HEAD>
<title>Error page, syntax error</title>
</HEAD><BODY>
<H1>Error has happened in the code</H1><pre>
(0): error &H1c:Command is not implemented and no currently loaded extension module defined behaviour for it
but your app doesn't run either.
Code: [Select]
[root@kahuna TestApps]# scriba tinyXML.bas
Status: 200 OK
Content-Type: text/html

<HTML><HEAD>
<title>Error page, syntax error</title>
</HEAD><BODY>
<H1>Error has happened in the code</H1><pre>
(0): error &H10:The requested module can not be loaded.
All straight apps, without IMPORT's, seem to work OK.
INCLUDE works OK, there is just a problem with the IMPORT.

I guess everything is on hold, for me, untill I can figure this out.
If I can't get the "as distributed" scriptbuilder to work properly, then there's no sense taking it further.

Tom


Support

  • Administrator
  • *****
  • Posts: 22
    • View Profile
Re: ScriptBasic 3.0 Open Items
« Reply #23 on: January 09, 2011, 11:33:00 AM »
Tom,

I don't have a 64 bit box to try SB on. Armando has SB running on 64 bit Windows, Linux and the Mac with no reported problems.

Do you have a 32 bit system you can try and then move to 64 bit once you have a working 32 bit dev setup?

John

mesbas

  • Guest
Re: ScriptBasic 3.0 Open Items
« Reply #24 on: January 09, 2011, 01:51:13 PM »
John,

It's a whole lot more complicated than that!

I found out why the t.bas thing didn't work.
It seems that the t.so file, and every other .so file in the bin/mod/dll directory, was compiled on Sept 13 2009.
On top of that, they were compiled on an Intel 80386.
Code: [Select]
[root@kahuna dll]# file t.so
t.so: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, not stripped
Now that's not a bad thing if you have a compatable processor.
If you have anything different, then those files need to be re-compiled.
I was able to recompile them by touching the source files to make it look like changes were made.
Code: [Select]
[root@kahuna dll]# file t.so
t.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, not stripped
That worked for most of them, but the developement packages need to be installed for others.
For example, to compile the mysql.so, I had to install the mysql-devel package.
Still need devel for curl, odbc and xml.

What kind of Linux does Armondo have it running on?

You have no idea how much has to be done to get this system to compile and work for every flavor of Linux, Windows and Mac.
Actually, you probably DO know.


I'll chip away at it, but I'm an old retired guy and my wife likes for us to travel, so time is at a premium.

Tom

Support

  • Administrator
  • *****
  • Posts: 22
    • View Profile
Re: ScriptBasic 3.0 Open Items
« Reply #25 on: January 09, 2011, 03:11:22 PM »
Tom,

./setup compiles everything with one command. I only use make when I have a problem compiling an extension module I may not have grabbed the development libraries for yet. ScriptBasic is literally generated from scratch. (header files, syntax tables, docs from C code, ...) I'm not sure what 64 bit OS Armando used. From what I gather he has a room full of toys and can generate anything one could imagine. He has lost all interest in the ScriptBasic project so we are on are own. Peter Verhas (ScriptBasic author) will help in a crisis but I try not to use that card unless it's my last resort and I did my due diligence beforehand.

John