Index: openacs-4/packages/acs-templating/tcl/query-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/query-procs.tcl,v diff -u -r1.14 -r1.15 --- openacs-4/packages/acs-templating/tcl/query-procs.tcl 28 Aug 2003 09:41:45 -0000 1.14 +++ openacs-4/packages/acs-templating/tcl/query-procs.tcl 3 Oct 2003 11:26:33 -0000 1.15 @@ -627,6 +627,8 @@
extend adds a column to an existing multirow
template::multirow append datasourcename value [value ...]
appends the row to an existing multirow.
+
template::multirow pop datasourcename
+
pops a row off an existing multirow, returning a list of the rows keys and values
template::multirow size datasourcename
returns the rowcount
template::multirow columns datasourcename
@@ -649,7 +651,7 @@ @param ulevel Used in conjunction with the "local" parameter to specify how many levels up the multirow variable resides. - @param command Multirow datasource operation: create, extend, append, size, get, set, foreach, upvar + @param command Multirow datasource operation: create, extend, append, pop, size, get, set, foreach, upvar @param name Name of the multirow datasource @@ -679,6 +681,24 @@ } } + pop { + upvar $multirow_level_up $name:rowcount rowcount $name:columns columns + set r_list [list] + if {$rowcount > 0} { + upvar $multirow_level_up $name:$rowcount row + for { set i 0 } { $i < [llength $columns] } { incr i } { + set key [lindex $columns $i] + if {[info exists row($key)]} { + set value $row($key) + lappend r_list $key $value + } + } + array unset row + } + incr rowcount -1 + return $r_list + } + append { upvar $multirow_level_up $name:rowcount rowcount $name:columns columns incr rowcount @@ -823,7 +843,7 @@ default { error "Unknown command $command in template::multirow. - Must be create, extend, append, get, set, size, upvar, or foreach." + Must be create, extend, append, backup, get, set, size, upvar, or foreach." } } }