Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Code Samples & Tips > Additional Libraries
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Additional Libraries Users contributed libraries.
This sub-forum is only available to licensed users.

Scripting library for B4ppc

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-24-2008, 11:27 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 5,953
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default Scripting library for B4ppc

This is a library for executing scripts written in a syntax that is as close to that of Basic4ppc as I could implement. I've been working on this library on and off for a few months now and have finally done the documentation for release. I wrote this library more out of a personal interest and challenge rather than having a real use in mind, but now I've done it I might as well release it in case it is of some use to somebody. A programmable calculator is an obvious use.

The library will work on all versions of .NET and on the desktop and device. As it is interpreted and written for convenience of implementation rather than efficiency it is rather slow (EDIT:- Not any more as of version 1.2) on the device compared to B4ppc. This time I've remembered that not everybody is running the next release beta so the demo source is compatible with B4ppc version 6.30.

I am sure that there will be some bugs in this library as I have not done production quality checking of it.

I should also mention, in case you haven't noticed, that by some strange coincidence maXim has also been working on a script library and released it here a few days ago http://www.basic4ppc.com/forum/itali...s-library.html

EDIT:- Version 1.2 posted. See post #6 for details.

EDIT:- Version 2.0 posted.See post #7 for details.

EDIT:- Version 2.1 posted.See post #8 for details.

EDIT:- Script help 1.0 posted.See post #9 for details.

EDIT:- Version 2.2 posted, including B4Script help. See post #10 for details.

EDIT:- Version 2.3 posted, including better B4Script help. See post #11 for details.

EDIT:- Version 2.4 posted, bug fixed and including even better B4Script help. See post #16 for details.

EDIT:- Version 3.0 posted. See post #17 for details.

EDIT:- Version 3.1 posted. See post #28 for details.

EDIT:- Version 3.2 posted. See post #31 for details.

EDIT:- Version 3.3 posted. See post #43 for details.

EDIT:- Version 3.4 posted. See post #44 for details.

EDIT:- Version 3.5 posted. See post #46 for details.

EDIT :- Version 4.0 for use with Basic4ppc v6.90 or later posted. See post #50 for details.

EDIT :- Version 4.1 for use with Basic4ppc v6.90 or later posted. See post #52 for details.

EDIT :- Version 4.2 for use with Basic4ppc v6.90 or later posted. See post #59 for details.
Attached Files
File Type: zip BasicLib3.5.zip (123.1 KB, 149 views)
File Type: zip BasicLib4.2.zip (124.5 KB, 95 views)

Last edited by agraham : 10-05-2010 at 11:59 AM.
Reply With Quote
  #2 (permalink)  
Old 09-24-2008, 04:29 PM
specci48's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: Germany
Posts: 993
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

Quote:
Originally Posted by agraham View Post
EDIT:- I've just noticed that a line in the locals.bas example is not correct. It should be "Sub test2(a#, b#)".
It would be nice if you could correct your upload so we won't need to save this post separately to the .zip file. It's hard to remember such a correction if someone saves your great dll for later use...


specci48
Reply With Quote
  #3 (permalink)  
Old 09-24-2008, 05:57 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 5,953
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

Quote:
Originally Posted by specci48 View Post
It would be nice if you could correct your upload
I intend to do that when the inevitable bug(s) surface and I had to update the library at which point I will upload a complete new zip with everything in it as I usually do.
Reply With Quote
  #4 (permalink)  
Old 09-24-2008, 06:01 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 13,162
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

Thank you once again for your innovative creations.
Reply With Quote
  #5 (permalink)  
Old 09-24-2008, 09:40 PM
specci48's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: Germany
Posts: 993
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

Quote:
Originally Posted by Erel View Post
Thank you once again for your innovative creations.
Reply With Quote
  #6 (permalink)  
Old 09-29-2008, 05:20 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 5,953
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

Having got a fairly robust working program in the initial release I have done some performance optimising and version 1.2, now posted, runs between 10 and 20 times faster than previously depending upon what it is actually doing.

This version now copes with Return within If, For or Do loops and implements Else If.

The treament of args() is changed to set individual variables with argument items rather than setting A as the args() array. This gives a cleaner way of pre-loading variables. A Starting event and GetArray and SetArray methods are added. Whereas the args() mechanism allows non-array variables to be preset the Starting event, together with SetArray allows arrays to be pre-initialised.

A few small bugs were also fixed

Last edited by agraham : 09-29-2008 at 05:52 PM.
Reply With Quote
  #7 (permalink)  
Old 10-02-2008, 02:10 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 5,953
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

After optimising the library for performance I realised that I now had a good structure that would let me implement proper variable names without performance penalties. This version now programs identically to Basic4ppc - as long as you use its subset of Basic4ppc facilities. Check out the Base64vnames.bas program.

Arguments are now handled as in Basic4ppc by a predefined args() array. An extra event, CallHost, is provided - see the help for why.

In the end I am very pleased with this library, even though it is pretty useless except for a few specialist applications that require runtime scripting. The performance now is very close to that of a legacy compiled Basic4ppc application which I think is pretty good going
Reply With Quote
  #8 (permalink)  
Old 10-07-2008, 02:59 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 5,953
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

The addition of proper variable names broke Rem and all the Date and Time functions. Version 2.1 fixes them together with various other small performance and bug fixes.

Goto and labels added and also the traditional ? as a synonym for Print.

This is now feature complete (I think!). Just bug fixes from now on!

The zip includes a desktop IDE for the library that can watch a couple of variables during step and break. This is in the code format for version 6.42 and later but you can get it to run on 6.30 by saving a minimal 6.30 sbp file, opening both that file and the 6.42 file in Notepad or Wordpad and cutting and pasting the form.control/generation statements and the code from the 6.42 version into the appropriate positions in the 6.30 file - or you could wait for the release of 6.50
Reply With Quote
  #9 (permalink)  
Old 01-14-2009, 11:53 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 5,953
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

Thanks to Erel allowing me to use the Basic4ppc help file as a base I have now posted help for the language elements implemented in the BasicLib script engine. With a total lack of originality (and imagination) I have named this script language B4Script. If you wrote an app that implemented scripting you could pass this help file to your users as part of the documentation on how to use scripting in your app.
Reply With Quote
  #10 (permalink)  
Old 01-17-2009, 11:54 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 5,953
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

Version 2.2 now posted. The main reason for this was to correct the same oversight I had made with GPSSerial where problems arose with OS culture settings that did not use full stop as the decimal separator. Hopefully this library is now robust in this regard.

I took the opportunity to makes some other changes -

Sleep(mSecs) is added to the language as it may be useful if a script is running on a separate thread.

Version is added which returns the same version number to a script as DllVersion returns to the library host program.

An updated B4Script help file for the script language is included which may be provided to a user if you implement a scripting facility in your app.

Script source files in the demos are now *.src to avoid confusion with Basic4ppc modules which are *.bas

Last edited by agraham : 01-17-2009 at 12:57 PM.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Build proper desktop apps in B4PPC with this awesome Forms library agraham Additional Libraries 25 07-30-2008 05:19 PM
B4PPC on USB stick Put Claude Questions (Windows Mobile) 1 01-04-2008 02:33 PM
must B4PPC be installed on C:\ Put Claude Questions (Windows Mobile) 4 01-02-2008 01:05 PM
compression and decompression library or B4PPC Code Louis Questions (Windows Mobile) 1 08-26-2007 08:06 PM
SQLite 3 and b4ppc magi6162 Questions (Windows Mobile) 1 08-23-2007 02:36 PM


All times are GMT. The time now is 02:43 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0