programming.nbk: Home | Index | Next Page: Tcl Mk4Tcl: Storing and Retrieving Data | Previous Page: Tcl Mk4Tcl: Reading/Writing from Tcl Arrays


 Tcl Mk4Tcl: Setting Properties

Setting Properties

To set one or more properties for a row, use the "mk::set" command, which takes a row reference (i.e. db.viewname!rownum) and a list of one or more property names and values. So for example to change the salary of the employee at index 3 in the employees view, we could use:

    mk::set db.employees!3 salary 25

The last mk::row append in the previous section could also be written as:

    set row [mk::row append db.employees]
    mk::set $row name "Mark" employeeid 1 salary 10

Remember to use "mk::file commit" periodically after storing data in your files.

Next: Tcl Mk4Tcl: Iterating over rows


programming.nbk: Home | Index | Next Page: Tcl Mk4Tcl: Storing and Retrieving Data | Previous Page: Tcl Mk4Tcl: Reading/Writing from Tcl Arrays


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