Open Forum > What's New

ScriptBasic 3.0 Open Items

<< < (4/6) > >>

mesbas:

--- Code: ---[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
--- End code ---

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: ---.PHONY: all

LD_FLAGS = -shared
EXTRA_CFLAGS = -fPIC
--- End code ---

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: ---grep RAD *.c
--- End code ---
from 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:

--- Code: ---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#

--- End code ---

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


--- Code: ---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$

--- End code ---

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!

Support:
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

mesbas:
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: ---chmod +x convert.sh setup
./convert.sh
perl syntaxer.pl
./setup
make clean
make
./setup --install
./install

--- End code ---

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:
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: ---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

--- End code ---

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version