Multi-dimensional arrays, tutorial?

Dick Kriesel dick.kriesel at mail.com
Tue Aug 10 17:23:23 EDT 2010


On Aug 10, 2010, at 12:53 AM, FlexibleLearning wrote:
 
> Can someone point me to an explanation or tutorial on using
> multi-dimensional arrays, and specifically persistence between
> sessions?

Hi, Hugh.  If you'd like to see a script locals persistence toolkit, I'd be
glad to share the code.  The library loads and stores script locals, as
you've seen in other replies, but goes further by enabling operations on
multiple arrays in a single invocation, and by enabling operations on arrays
within arrays.

The primary handler in the library starts with this:

command scriptLocals_op pOperation, pVariableNames, pKey, pRevObject
   /*
   pOperation is among the items of
"register,load,store,empty,unregister,remove"
   pVariableNames can be a list delimited by cr, comma, or space.
   pVariableNames is optional; without it, the command operates on all
script locals identified in previous executions of the command.
   pKey can be a string that is a top-level subscript of the array.
   pKey can be a sequentially-keyed array that determines a compound
subscript of the array.
   pKey is optional; without it, the command operates on whole arrays rather
than on elements of arrays.
   pRevObject can identify any Rev object.
   pRevObject is optional; without it, the Rev object is the one whose
script invokes the command.

   The command performs the operation in the context of the Rev object on
the Rev object's own script locals.
   */
 
Please let me know if you have questions or if you'd like to see the
library.

-- Dick





More information about the Use-livecode mailing list