ScriptBasic

Open Forum => What's New => Topic started by: Support on August 13, 2010, 09:20:46 PM

Title: ScriptBasic 3.0 Open Items
Post by: Support on August 13, 2010, 09:20:46 PM
Here is a list of tasks for the 3.0 release. If you have some time to contribute to the ScriptBasic project, your efforts will count in a big way towards making ScriptBasic an industry standard scripting language.



If any of the above items are within your skill level and you're able to help with the project, please respond with what task you would like to work on.
Title: Re: ScriptBasic 3.0 Open Items
Post by: Support on August 17, 2010, 01:28:26 AM
To get the ball rolling towards a 3.0 release, I'll take on the task of generating the HTML documentation from the C source files. This was done by a Perl script in the 2.1 version and will now be done with a ScriptBasic (scriba) script.

Don't be shy, select a task from the above list and help the ScriptBasic open source project along.

Title: Re: ScriptBasic 3.0 Open Items
Post by: dons333 on November 04, 2010, 01:13:31 PM
I'm interested in Scriptbasic. I cut my teeth on BASIC back in the 80's. I would love to be able to help some, but I'm afriad my programming skills are remedial with regards to the help you require.

Title: Re: ScriptBasic 3.0 Open Items
Post by: mesbas on December 07, 2010, 12:05:19 PM
 ::) Don't give up yet!

I'd like to help out a little, if I can.

I was looking at the Reserved Word List and noticed a bunch of "Not Implemented" functions at the end.

Some look pretty simple. Most are pretty ambitious projects.

The CVI function, on the surface, looks pretty simple.
But a 2 byte return assumes either unsigned short with a range of 0 - 65535 or a signed short with a range of (-32768) - 32767.
Which one of those is correct?
Same for CVD, CVL and CVS.
 
The MKI function really has me stumped.  Does (2 byte) in the description refer to the argument or the answer?
I assume it means convert a signed or unsigned integer to a string of whatever length is required.

I'll look at the source to see if I understand the way existing things are handled.

Tom
Title: Re: ScriptBasic 3.0 Open Items
Post by: Support on December 07, 2010, 12:20:48 PM
Thanks Tom!

I have been wanting to get the stub functions going since 2006. That is so cool you're chipping away at the 3.0 task list. I will be happy to test and document (best if done in C source so I can auto generate) your contributions and get them included in the distribution.

I'll send Armando an  e-mail and see if he can comment on your questions.

Title: Re: ScriptBasic 3.0 Open Items
Post by: Airr on December 07, 2010, 06:29:42 PM
Not sure how Peter originally envisioned these, but I can tell you how it's set in MBC/BCX/etc (hope you don't mind).

CVI - signed short return value

MKI - signed short parameter, 2-byte fixed length string return value.

Even though it's old and not C, you might want to look at This Old MS KB Article (http://support.microsoft.com/kb/87970) for some tips.

Writing those functions is really simple; we use memmove in place of the hmemcpy Microsoft suggests in the article, and of course C instead of VB for the actual functions....

A.
Title: Re: ScriptBasic 3.0 Open Items
Post by: mesbas on December 08, 2010, 07:08:21 AM
I can see returning a signed short for the CVI.
The argument string will have to be between "-32768" and "32767".
Those are the min and max for a signed short.

Going back using MKI can't be limited to a 2 byte return value.
How do you represent the number 32767 as a 2 byte string?
A 2 byte string could only contain numbers from -9 to 99.

Maybe I'm a little confused, how can you stuff a 5 character string into a 2 character container.

Tom

PS

OK, OK, OK
I got it now!!!

The MKI function and the CVI function are compliments to each other.
The 2 byte string created by MKI is a representation of the number, and not meant to be readable by a human.

I see the light!!  Thank you Airr.
Title: Re: ScriptBasic 3.0 Open Items
Post by: mesbas on December 31, 2010, 08:19:51 AM
Something to ponder after we ring in the new year.

Regarding the, yet to be implemented, TAN() function:
This function historically gives you the tangent of an angle measured in radians.
   Eg:  tangent = TAN(radians)

Since most angles are measured in degrees, another function is needed to convert degrees to radians.
   Eg:  radians = RAD(degrees)

So……  We can either change the definition and functionality of our TAN() function, to accept degrees directly, or add a new RAD() function.

If we change the TAN() function to use degrees directly, what happens to those folks that only have the radians value?  Do we add another function to convert radians to degrees?

My vote is to create the new RAD() function.
I,m not a mathematician so guidance is requested.
Title: Re: ScriptBasic 3.0 Open Items
Post by: Support on December 31, 2010, 12:06:49 PM
Quote from: Tom
My vote is to create the new RAD() function.

+1

Title: Re: ScriptBasic 3.0 Open Items
Post by: mesbas on January 03, 2011, 04:35:15 AM
I created the new RAD() function.
I also implemented 11 of the unimplemented math functions.
How do I submit the code for testing?
Title: Re: ScriptBasic 3.0 Open Items
Post by: Support on January 03, 2011, 03:07:53 PM
That's great news Tom!

Do you have any SB script(s) you used to test this with?

Can you post (as an attachment) the files you changed and any notes you wish to share?

I would be happy to test and create a new Ubuntu build for testing. If your doing this on Windows, creating a scriba.exe for folks to test with would be great.

I'm in the process of setting up a developers site only that will give us online source editing, FTP, MySQL DB, console mode access and source control options. (level of access will increase as one becomes more involved in the project)

John
Title: Re: ScriptBasic 3.0 Open Items
Post by: mesbas on January 07, 2011, 01:42:43 PM
Sorry! I don't do windows development.
I'm still trying to get cygwin working on my windows 7 box, but it's really not a priority.

I've attached the 4 files that were modified.
They're big files, that developers site or diff files for patching, would be easier ways to go.

Put notimp.h, syntax.h and syntax.def into the scriptbasic directory.
Put mathfunc.c into the scriptbasic/commands directory.
I only modified the base files, so syntaxer.pl has to be run to create syntax.c and notimp.c.
After that, from the source directory of an already installed and working scriptbasic, I only do:
    make clean
    make
    ./install.sh

I'm doing this on Fedora release 14 running kernel 2.6.35 on an x86_64 processor.
Depending on your OS or something else, you may have to do it differently.
Title: Re: ScriptBasic 3.0 Open Items
Post by: mesbas on January 07, 2011, 01:48:12 PM
Because of the 4 file attachment limit, the SB test program is included here.

Everything works fine for me.  I was able to compile the test program into an executable.

This is a first for me, so lets hope there arn't many problems.
Title: Re: ScriptBasic 3.0 Open Items
Post by: Support on January 07, 2011, 04:06:11 PM
Thanks Tom for the help with ScriptBasic. I understand your reluctance to invest any time with Windows. I have only visited my Windows XP partition twice in the last few months. It becomes obvious that Windows is a bloated kludge with more layers than an onion. Linux just works and I'm not always pulling out my wallet to upgrade a package or pay for another year of subscription services. I hope Microsoft wakes up to the fact that their screwed knowing that people have an option outside their monopoly. I posted your MathTest script so others can get an idea what your enhancements bring to the table. My plan over the next month or so is to put in place a solid source control system. I'm still looking at all the options. I don't want to do this more than once.

Code: [Select]
'
' Given the starting value of 34 degrees, calculate radians.
' Given the radian value, calculate TAN, COTAN, SECANT and COSECANT.
' Given the TAN, COTAN, SECANT and COSECANT values,
' calculate the ATAN, ACTAN, ASECANT and ACOSECANT.
'
degval = 34
radval = RAD(degval)
zerval = 0

tanval = TAN(radval)
cotval = COTAN(radval)
secval = SECANT(radval)
cseval = COSECANT(radval)

ataval = ATAN(tanval)
actval = ACTAN(cotval)
aseval = ASECANT(secval)
acoval = ACOSECANT(cseval)

hsinv = HSIN(radval)
hcosv = HCOS(radval)
htanv = HTAN(radval)
hsecv = HSECANT(radval)
hcosc = HCOSECANT(radval)
hcotv = HCTAN(radval)

print "\nThe following 8 functions accept radians as their argument, so we "
print "use the\nnew RAD() function to convert ",degval," degrees to ",radval," (",str$(radval),") radians.\n\n"

print "Tangent\t\tCotangent\tSecant\t\tCosecant\n"
print "TAN()  \t\tCOTAN()  \tSECANT()    \tCOSECANT()\n"
print tanval," \t",cotval,"\t",secval," \t",cseval,"\n"
print str$(tanval)," \t",str$(cotval)," \t",str$(secval)," \t",str$(cseval),"\n\n"

print "Arctangent\tArccotangent\tArcsecant\tArccosecant\n"
print "ATAN()    \tACTAN()  \tASECANT()\tACOSECANT()\n"
print ataval," \t",actval," \t",aseval," \t",acoval,"\n"
print str$(ataval)," \t",str$(actval)," \t",str$(aseval)," \t",str$(acoval),"\n\n"

print "There are 6 Hyperbolic functions. They also accept radian arguments.\n\n"
print "H-Sine\t\tH-Cosine\tH-Tangent\n"
print "HSIN()\t\tHCOS()  \tHTAN()\n"
print hsinv," \t",hcosv," \t",htanv,"\n"
print str$(hsinv)," \t",str$(hcosv)," \t",str$(htanv),"\n\n"

print "H-Secant\tH-Cosecant\tH-Cotangent\n"
print "HSECANT()\tHCOSECANT()\tHCTAN()\n"
print hsecv," \t",hcosc," \t",hcotv,"\n"
print str$(hsecv)," \t",str$(hcosc)," \t",str$(hcotv),"\n\n"
Title: Re: ScriptBasic 3.0 Open Items
Post by: Support on January 08, 2011, 02:09:47 AM
Tom,

Scriba is giving me a segmentation fault with any script I run. I followed your instructions in your post.

Is there any chance you use something 64 bit specific? (running Ubuntu 32 bit here)

I'm able to get the command line options if I don't pass a script and -D and -v both work. I didn't see any warnings or errors with the make.

John

Code: [Select]
root@Laptop:/usr/src/scriptbasic# perl syntaxer.pl
root@Laptop:/usr/src/scriptbasic# make clean
rm -rf bin/exe/*
rm -rf bin/include/*
rm -rf bin/lib/*
rm -rf bin/make/*
rm -rf bin/obj/*
rm -rf bin/var/*
root@Laptop:/usr/src/scriptbasic# make
gcc  -w -c -o bin/obj/basext.o basext.c
gcc  -w -c -o bin/obj/builder.o builder.c
gcc  -w -c -o bin/obj/buildnum.o buildnum.c
gcc  -w -c -o bin/obj/confpile.o confpile.c
gcc  -w -c -o bin/obj/conftree.o conftree.c
gcc  -w -c -o bin/obj/dynlolib.o dynlolib.c
gcc  -w -c -o bin/obj/epreproc.o epreproc.c
gcc  -w -c -o bin/obj/errcodes.o errcodes.c
gcc  -w -c -o bin/obj/execute.o execute.c
gcc  -w -c -o bin/obj/expression.o expression.c
gcc  -w -c -o bin/obj/filesys.o filesys.c
gcc  -w -c -o bin/obj/getopt.o getopt.c
gcc  -w -c -o bin/obj/hndlptr.o hndlptr.c
gcc  -w -c -o bin/obj/hookers.o hookers.c
gcc  -w -c -o bin/obj/httpd.o httpd.c
gcc  -w -c -o bin/obj/ipreproc.o ipreproc.c
gcc  -w -c -o bin/obj/lexer.o lexer.c
gcc  -w -c -o bin/obj/logger.o logger.c
gcc  -w -c -o bin/obj/lsp.o lsp.c
gcc  -w -c -o bin/obj/match.o match.c
gcc  -w -c -o bin/obj/memory.o memory.c
gcc  -w -c -o bin/obj/modumana.o modumana.c
gcc  -w -c -o bin/obj/myalloc.o myalloc.c
gcc  -w -c -o bin/obj/mygmtime.o mygmtime.c
gcc  -w -c -o bin/obj/options.o options.c
gcc  -w -c -o bin/obj/reader.o reader.c
gcc  -w -c -o bin/obj/report.o report.c
gcc  -w -c -o bin/obj/scriba.o scriba.c
gcc  -w -c -o bin/obj/sym.o sym.c
gcc  -w -c -o bin/obj/syntax.o syntax.c
gcc  -w -c -o bin/obj/thread.o thread.c
gcc  -w -c -o bin/obj/uniqfnam.o uniqfnam.c
gcc  -w -c -o bin/obj/md5.o md5.c
gcc  -w -c -o bin/obj/environ.o commands/environ.c
gcc  -w -c -o bin/obj/external.o commands/external.c
gcc  -w -c -o bin/obj/extops.o commands/extops.c
gcc  -w -c -o bin/obj/file.o commands/file.c
gcc  -w -c -o bin/obj/function.o commands/function.c
gcc  -w -c -o bin/obj/goto.o commands/goto.c
gcc  -w -c -o bin/obj/if.o commands/if.c
gcc  -w -c -o bin/obj/let.o commands/let.c
gcc  -w -c -o bin/obj/mathfunc.o commands/mathfunc.c
gcc  -w -c -o bin/obj/mathops.o commands/mathops.c
gcc  -w -c -o bin/obj/print.o commands/print.c
gcc  -w -c -o bin/obj/string.o commands/string.c
gcc  -w -c -o bin/obj/time.o commands/time.c
gcc  -w -c -o bin/obj/while.o commands/while.c
ar -r bin/lib/lscriba.a  bin/obj/basext.o bin/obj/builder.o bin/obj/buildnum.o bin/obj/confpile.o bin/obj/conftree.o bin/obj/dynlolib.o bin/obj/epreproc.o bin/obj/errcodes.o bin/obj/execute.o bin/obj/expression.o bin/obj/filesys.o bin/obj/getopt.o bin/obj/hndlptr.o bin/obj/hookers.o bin/obj/httpd.o bin/obj/ipreproc.o bin/obj/lexer.o bin/obj/logger.o bin/obj/lsp.o bin/obj/match.o bin/obj/memory.o bin/obj/modumana.o bin/obj/myalloc.o bin/obj/mygmtime.o bin/obj/options.o  bin/obj/reader.o bin/obj/report.o bin/obj/scriba.o bin/obj/sym.o bin/obj/syntax.o bin/obj/thread.o bin/obj/uniqfnam.o bin/obj/md5.o bin/obj/environ.o bin/obj/external.o bin/obj/extops.o bin/obj/file.o bin/obj/function.o bin/obj/goto.o bin/obj/if.o bin/obj/let.o bin/obj/mathfunc.o bin/obj/mathops.o bin/obj/print.o bin/obj/string.o bin/obj/time.o bin/obj/while.o
ar: creating bin/lib/lscriba.a
mkdir bin/var/standard || echo
gcc  -w -c -o bin/var/standard/scribacmd.o variations/standard/scribacmd.c
gcc  -w -c -o bin/obj/lmt_none.o lmt_none.c
gcc  -w -o bin/exe/scriba bin/var/standard/scribacmd.o bin/obj/lmt_none.o bin/lib/lscriba.a -lc -lm -ldl -lpthread
bin/exe/scriba -v
ScriptBasic v2.1
Variation >>STANDARD<< build 1
Magic value 859002424
Node size is 16
Extension interface version is 11
Compilation: Jan  8 2011 02:01:00
mkdir bin/var/httpd || echo
gcc  -w -c -o bin/var/httpd/websrv.o variations/httpd/websrv.c
mkdir bin/var/httpd || echo
mkdir: cannot create directory `bin/var/httpd': File exists

gcc  -w -c -o bin/var/httpd/service.o variations/httpd/service.c
gcc  -w -o bin/exe/sbhttpd bin/var/httpd/websrv.o bin/var/httpd/service.o bin/obj/lmt_none.o bin/lib/lscriba.a -lc -lm -ldl -lpthread
gcc  -w -c -o bin/obj/stndlone.o stndlone.c
ar -r bin/lib/libscriba.a  bin/obj/basext.o bin/obj/builder.o bin/obj/buildnum.o bin/obj/confpile.o bin/obj/conftree.o bin/obj/dynlolib.o bin/obj/epreproc.o bin/obj/errcodes.o bin/obj/execute.o bin/obj/expression.o bin/obj/filesys.o bin/obj/getopt.o bin/obj/hndlptr.o bin/obj/hookers.o bin/obj/httpd.o bin/obj/ipreproc.o bin/obj/lexer.o bin/obj/logger.o bin/obj/lsp.o bin/obj/match.o bin/obj/memory.o bin/obj/modumana.o bin/obj/myalloc.o bin/obj/mygmtime.o bin/obj/options.o  bin/obj/reader.o bin/obj/report.o bin/obj/scriba.o bin/obj/sym.o bin/obj/syntax.o bin/obj/thread.o bin/obj/uniqfnam.o bin/obj/md5.o bin/obj/environ.o bin/obj/external.o bin/obj/extops.o bin/obj/file.o bin/obj/function.o bin/obj/goto.o bin/obj/if.o bin/obj/let.o bin/obj/mathfunc.o bin/obj/mathops.o bin/obj/print.o bin/obj/string.o bin/obj/time.o bin/obj/while.o bin/obj/stndlone.o
ar: creating bin/lib/libscriba.a
ld -shared -o bin/lib/libscriba.so  bin/obj/basext.o bin/obj/builder.o bin/obj/buildnum.o bin/obj/confpile.o bin/obj/conftree.o bin/obj/dynlolib.o bin/obj/epreproc.o bin/obj/errcodes.o bin/obj/execute.o bin/obj/expression.o bin/obj/filesys.o bin/obj/getopt.o bin/obj/hndlptr.o bin/obj/hookers.o bin/obj/httpd.o bin/obj/ipreproc.o bin/obj/lexer.o bin/obj/logger.o bin/obj/lsp.o bin/obj/match.o bin/obj/memory.o bin/obj/modumana.o bin/obj/myalloc.o bin/obj/mygmtime.o bin/obj/options.o  bin/obj/reader.o bin/obj/report.o bin/obj/scriba.o bin/obj/sym.o bin/obj/syntax.o bin/obj/thread.o bin/obj/uniqfnam.o bin/obj/md5.o bin/obj/environ.o bin/obj/external.o bin/obj/extops.o bin/obj/file.o bin/obj/function.o bin/obj/goto.o bin/obj/if.o bin/obj/let.o bin/obj/mathfunc.o bin/obj/mathops.o bin/obj/print.o bin/obj/string.o bin/obj/time.o bin/obj/while.o bin/obj/lmt_none.o -lc -lm -ldl -lpthread
root@Laptop:/usr/src/scriptbasic# cd bin/exe
root@Laptop:/usr/src/scriptbasic/bin/exe# ls -l
total 1020
-rwxr-xr-x 1 root jrs 529394 2011-01-08 02:01 sbhttpd
-rwxr-xr-x 1 root jrs 507943 2011-01-08 02:01 scriba
root@Laptop:/usr/src/scriptbasic/bin/exe# mv /usr/bin/scriba /usr/bin/scriba-2.1
root@Laptop:/usr/src/scriptbasic/bin/exe# mv /usr/bin/sbhttpd /usr/bin/sbhttpd-2.1
root@Laptop:/usr/src/scriptbasic/bin/exe# cp scriba /usr/bin
root@Laptop:/usr/src/scriptbasic/bin/exe# cp sbhttpd /usr/bin
root@Laptop:/usr/src/scriptbasic/bin/exe# exit
logout
jrs@Laptop:~$ cd SB/test
jrs@Laptop:~/SB/test$ scriba -v
ScriptBasic v2.1
Variation >>STANDARD<< build 1
Magic value 859002424
Node size is 16
Extension interface version is 11
Compilation: Jan  8 2011 02:01:00
jrs@Laptop:~/SB/test$ scriba MathTest.bas
Segmentation fault
jrs@Laptop:~/SB/test$
Title: Re: ScriptBasic 3.0 Open Items
Post by: mesbas 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.
Title: Re: ScriptBasic 3.0 Open Items
Post by: Support 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!

Title: Re: ScriptBasic 3.0 Open Items
Post by: Support 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
Title: Re: ScriptBasic 3.0 Open Items
Post by: mesbas 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.
Title: Re: ScriptBasic 3.0 Open Items
Post by: Support 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 (http://www.thinbasic.com/community/showthread.php?10984-removing-HTML-code-from-file&p=82164#post82164) 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

Title: Re: ScriptBasic 3.0 Open Items
Post by: mesbas 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.
Title: Re: ScriptBasic 3.0 Open Items
Post by: Support 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?

Title: Re: ScriptBasic 3.0 Open Items
Post by: mesbas 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

Title: Re: ScriptBasic 3.0 Open Items
Post by: Support 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
Title: Re: ScriptBasic 3.0 Open Items
Post by: mesbas 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
Title: Re: ScriptBasic 3.0 Open Items
Post by: Support 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