SIGN UP MEMBER LOGIN:    
ARTICLE

XbWrapper - Xbase Interpreter

Posted by vus1 Articles | Current Affairs March 15, 2002
XbWrapper-Xbase script inter XbWrapper is a simple scripting language. It is intended to use as an embedded language in other C# programs.
Reader Level:
Download Files:
 

XbWrapper-Xbase script interXbWrapper is a simple scripting language.It is intended to use as an embedded language in other C# programs.It's an Xbase style script language.XbWrapper is small and simple, and is only one thousand lines of source. So if the functionality you are looking for is more than a simple configuration file parser, XbWrapper could be for you. XbWrapper based on interpreter and wrapper functions library. This library is designed as a set of XBase commands and functions and provided wrappers for work with Access databases. You establish connection from your application and further in the scripts, work with the Access tables using XBase like functions and commands in application:

XbParser parser=new XbParser(lexer);
parser.DbClass=new DbWrapper("book.mdb");

in script:

# bookstock is table from book.mdb
# make dataset
use bookstock
# set current work table
select bookstock
while !eof()
? bookstosk.booktitle
# in expression bookstock is table and booktitle is field name
# bookstosk.booktitle=something means store in field "booktitle" variable
# something
skip
endwhile          

There are some XBase like functions and commands that you may use with your
scripts application. These are:

use <tablename>
select <tablename>
skip
eof()
fcount()
recno()
reccount()
field(integer n) ant etc.
For full information see source code.

Interpreter support:

Automatic declare variables (string,integer,double,boolean)
Conditional execution ('if','case' statements)
Loops ('while','for')
Functions
Local variable scope and array.
# declare array length of array=0
Declare ahtml[0]
# add element to array
AAdd(ahtml,"<TABLE Border>")
#Length of array =1
? Alen(ahtml)

The usual range of logic and math operators.script.xbs - contains example how to generate html page from database, written on XbWrapper.

Note: The submitted code is not a complete application and is intended for the educational purposes. The only requirement is .NET SDK Runtime environment.

Login to add your contents and source code to this article
share this article :
post comment
 
Become a Sponsor
PREMIUM SPONSORS
  • Finally – a virtual platform that delivers next-generation Windows Server 2008 Hyper-V virtualization technology from a managed hosting partner you can truly depend on. Visit www.maximumasp.com/max for a FREE 30 day trial. Hurry offer ends soon. Climb aboard the MaxV platform and take advantage of High Availability, Intelligent Monitoring, Recurrent Backups, and Scalability – with no hassle or hidden fees. As a managed hosting partner focused solely on Microsoft technologies since 2000, MaximumASP is uniquely qualified to provide the superior support that our business is built on. Unparalleled expertise with Microsoft technologies lead to working directly with Microsoft as first to offer IIS 7 and SQL 2008 betas in a hosted environment; partnering in the Go Live Program for Hyper-V; and product co-launches built on WS 2008 with Hyper-V technology.
    The leading .NET charting control now features PDF, Flash and Silverlight export, visualization of large datasets and more. Deliver true charting functionality to your BI, Scorecard, Presentation or Scientific apps. Download evaluation now.
Team Foundation Server Hosting
Become a Sponsor