programming.nbk: Home | Index | Next Page: Tcl Mk4Tcl: Queries | Previous Page: Tcl Mk4Tcl: Deleting rows


 Tcl Mk4Tcl: Iterating over rows

Iterating over Rows

If you just want to iterate over all the rows in a view, for example to do simple reporting or batch modifications, you can do this with the "mk::loop" command. Like "for" loop constructs in programming languages, a loop variable will be set to point to each row in turn. For example, to print out the names of all employees in our example:

    mk::loop i db.employees {
        puts [mk::get $i name]
    }

Next: Tcl Mk4Tcl: Deleting rows


programming.nbk: Home | Index | Next Page: Tcl Mk4Tcl: Queries | Previous Page: Tcl Mk4Tcl: Deleting rows


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