programming.nbk: Home | Index | Next Page: Tcl Mk4Tcl: Setting Properties | Previous Page: Tcl Mk4Tcl: Queries


 Tcl Mk4Tcl: Reading/Writing from Tcl Arrays

Reading/Writing from Tcl Arrays

The "mk::get" command returns a Tcl list in the format of "property value property value...". We can take advantage of the fact that this is the same format used by the Tcl "array set" command. This allows you to store the contents of an entire row into a Tcl array, and then use commands like "info exists", "array names", etc. to examine the properties, as well as constructs like "$arrayname(property)" to refer to a property.

Similarly, after you've read a row into an array and made some changes (or constructed the array manually), you can write it back using a construct like "eval mk::set db.viewname!rownum [array get arrayname]".

Next: Tcl Mk4Tcl: Data Types


programming.nbk: Home | Index | Next Page: Tcl Mk4Tcl: Setting Properties | Previous Page: Tcl Mk4Tcl: Queries


Notebook exported on Monday, 7 July 2008, 18:56:06 PM Eastern Daylight Time