Maxscript
Encyclopedia
MaxScript command processor is an interpreter that implements a subset of the xBase programming language
XBase
xBase is the generic term for all programming languages that derive from the original dBASE programming language and database formats. These are sometimes informally known as dBASE "clones"...

 especially conceived to be used inside web pages to provide server side scripting capabilities.
MaxScript is not to be confused with MAXScript, the scripting language of the 3D animation package 3ds Max.

As a command processor, MaxScript needs a web server to work with: whenever the web server receives a request for a MaxScript page it must pass it to the interpreter, that parses all the lines, top to bottom, in search of xBase cod to be executed. Then the page is passed back to web server that deliveries it to web browser.

MaxScript pages use the file extension .MSP.
MSP pages are standard HTML pages: they can contain XHTML and Javascript code, as well as xBase code.
xBase statements can consist on hundreds of lines or single function calls, always included into HTML server-side tags.

Tags for maxScript are similar to those used for PHP and other server-side scripting languages: to start xBase code into a web page the tag <% must be used. The tag %> marks the end of code.
MaxScript is used as the core of freeware products like dbfree
Dbfree
DBFree is a free software package for Microsoft Windows that includes a web server and an interpreter intended for developing web applications based on the xBase language dialect and conventions....

 and in its commercial counterpart DBMax

The latest version (2.21) is dated 2008 and implements a large subset of xBase commands and functions, and the capability of writing UDFs (User Defined Function) to be integrated in the language.

MaxScript was expressly designed to dynamically present live data on the internet and acts as a web server extension to process xBase/Clipper code from inside an HTML page. As such the interpreter needs a web server to work with, and all the pages to be processed must reside on a web site accessible to it.

The MaxScript Engine comes in form of a win32 executable and implements an xBase, Clipper-like, programming language reach of features, commands and functions for any and all web application purposes, and uses built-in drivers to dynamically access live data from DBF
DBF
DBF may refer to:*dBASE filename extension*Detection By Fire*Divorced Black Female in personal ads*dBf — Decibel as referring to 1 femtowatt*Drude-Born-Federov form of constitutive equations...

tables and present them to internet without the need of ODBC or ADO connections.

The engine supports most of the command and function of xBase (as USE, SET FILTER, INDEX, CREATE, etc.) and flow control structures (as DO..WHILE, DO..CASE, IF..ENDIF) and tens of standard xBase functions (for date handling, string manipulation, math managing, direct file access, etc.). User defined functions are also supported, and external libraries are provided for further extend language functionalities.

A simple hello world application:






Hello World! Time is <% ? time%>







A complete statement (opening a table and printing all the content, one record per line):





List of all customers:

<%
use CUSTOMERS
go top
do while not eof
? CUST_NO | NAME | SURNAME | ADDR | ZIPCODE | TOWN | STATE html
skip
enddo
%>





An example of control structures:

<%
nnn := 0 //-- creating a var (numeric type)
//-- looping
do while nnn < 5
nnn := nnn+1 //-- increasing
if nnn =
exit
endif
enddo
%>


The above samples are relative to the current implementation used by dbfree

Dbfree
DBFree is a free software package for Microsoft Windows that includes a web server and an interpreter intended for developing web applications based on the xBase language dialect and conventions....

and its commercial sibling DBMax.
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK