Table creation: Difference between revisions
Content added Content deleted
(→{{header|PostgreSQL}}: + Tcl) |
m (→{{header|Tcl}}) |
||
Line 38: | Line 38: | ||
=={{header|Tcl}}== |
=={{header|Tcl}}== |
||
Tables, as used in relational databases, seem far away conceptually from Tcl. However, the following code demonstrates how a table (implemented as a list of lists, the first being the header line) can be type-checked and rendered: |
Tables, as used in relational databases, seem far away conceptually from Tcl. However, the following code demonstrates how a table (implemented as a list of lists, the first being the header line) can be type-checked and rendered: |
||
<lang Tcl> |
<lang Tcl>proc table_update {_tbl row args} { |
||
proc table_update {_tbl row args} { |
|||
upvar $_tbl tbl |
upvar $_tbl tbl |
||
set heads [lindex $tbl 0] |
set heads [lindex $tbl 0] |
||
Line 110: | Line 109: | ||
balance 0.0 \ |
balance 0.0 \ |
||
created 2009-05-14 |
created 2009-05-14 |
||
puts [table_format $mytbl] |
puts [table_format $mytbl]</lang> |
||
</lang> |
|||
Output: |
Output: |
||
<pre> |
<pre> |