Version 0.50 of bBox Now Available
A new version of our free bBox FileMaker plug-in is now available.
Perhaps the most interesting addition for this version is the bBox_EvaluateList function, which is defined like so:
bBox_EvaluateList (values; expression {; delimiter} )
This syntactic construct is also available in Python and JavaScript, and is a convenient way of processing items in a list. As the function iterates through each item of the list, two variables are set. $i will contain the current item index (i.e., which item number in the list of values), and $v will be the value itself. The results for every item are concatenated to form the the function's result. Here is a trivial example:
bBox_EvaluateList ("a¶b¶c"; "$v")
That would give us the result of:
"abc"
The fact that $v is in quotes may seem weird, but remember that the function is getting passed a string expression to be evaluated for each item in the list. Essentially, it is calling FileMaker's built-in Evaluate function. There are of course other ways of doing this sort of thing using recursive custom function calls, but they are slow and limited in the number of values you can process. The case where the data contains quotes has also been handled, but the escaping of such things as quotes can still get a little tricky. Take this slightly more elaborate version of our previous example:
bBox_EvaluateList ("a¶b¶c"; "$i & \\\": \\\" & & $v & ¶")
returns the following:
1: a 2: b 3: c
The elaborate escaping sequences were needed in order to get FileMaker to compile the expression with the quotes inside the string. However, it is hopefully evident that it was worth the trouble to get the result.
Also new are the bBox_ListFields and bBox_ListTables functions. These are convenience functions that give schema information in a MySQL format. The detail however is somewhat limited when run on FileMaker version 10 or less. Especially of interest is that the table function finally gives us a way to find the base table name for a TO.
You can download the latest version of bBox at http://www.beezwax.net/download/bbox.
Learn more about the bBox plug-in at http://www.beezwax.net/bbox.
Version 0.50 turned out to be a bit short-lived.
I’ve now got version 0.51 posted, which fixes an issue with very large (12+ MB) text results for some functions (Bash, shell, sort, etc.) where FileMaker would hang due to errors attempting to allocate space for the result. The fix not only improves memory utilization but also performance with large (5+ MB) text results significantly.
Interestingly, calling Python to manipulate strings can be significantly faster than even the simpler FileMaker text processing routines, despite the extra overhead of having to compile the script, invoke the interpreter, and pass the parameters back and forth. I noticed this especially when I had operations that were repeatedly appending values to existing strings. Possibly some of this is due to Python typically using the more compact UTF-8 format, but the performance seems too striking for that to be the only reason.
Simon.