create. Copying existing table

^table::create[existing_table]

^table::create[existing_table;options]

This constructor creates an object of class table by copying data from already existing table. One can also specify a number of options to control copying, "Copying and search options".

Example
Code…

$orig[^table::create{name
Jack
Nick
Mary

}]

# sets row with "Nick" as current in $orig
^orig.offset(1)

# copies data starting with current row, taking 10 records at the most
$copy[^table::create[$orig;
    $.offset[cur]
    $.limit(10)
]]

^copy.menu{$copy.name}[, ]

…will output:
Nick, Mary


Copyright © 1997–2021 Art. Lebedev Studio | http://www.artlebedev.com Last updated: 02.03.2011