Skip to main content

Data-Slice

Command Description

Data slice

Command Prototype

objDatatable = Datatable.SliceDataTable(dtTable,aryRows,aryColumns)

Parameter Description

ParameterRequiredTypeDefaultDescription
dtTableTrueexpressionobjDatatableThe source datatable to be sliced
aryRowsTrueexpression[]Line slices of the data, array type, the first element represents the starting line, the last element represents the ending line
aryColumnsTrueexpression[]Column headers of a datatable

return

objDatatable,The variable used to save the output of the command.

Demo

aryData = [["a", 1], ["b", 2], ["c", 3]] 
aryColumns = ["letter", "number"]
objDatatable = Datatable.BuildDataTable(aryData,aryColumns)
objDatatable = Datatable.SliceDataTable(objDatatable,[0,1],["letter"])
TracePrint(objDatatable)
/*
letter
0 a
1 b
*/