So my scripting language choices are:
- VBA, when manipulating the Excel Object Model
- IronPython when accessing .NET internals, or for complex coding requirements when not using C# or VB.NET.
- SQL , for tabular set manipulations, and for the fact “that SQL does exactly what it says on the tin“.
Like PYTHON, a object “db” is passed into the script, this allows access to the SQLite instance via several functions:
- db.SQL(arg) will take a string arg holding a SQL command and execute it.
- db.SQL(arg,callback(arg)) as above but expects a SELECT statement and will return a JSON encoded object string via the callback’s arg for each row returned.
- myJSONTable = db.jsSQLQuery(arg) expects a SQL SELECT statement and will return the table as a single JSON encoded string as a List of Objects.
- myJSONReturn = db.JSONhammer(arg) will make a call as an internal HAMMER command where arg is a JSON encoded string of a List of commands. Will return a JSON encoded table or a string value.
- tableName = db.getArgNoTable(argNo) like above but returns a table name if the argument position holds a table rather than a string value.
A predefined JSON object is also passed in, offering the usual JSON.parse(arg) and JSON.stringify(obj) methods.
There’s also an alert(arg) command which will display a Window’s message box and a println(arg) command which will append to a _JSSTDOUT specified log file if one has been specified.