Data-Slice
Command Description
Data slice
Command Prototype
objDatatable = Datatable.SliceDataTable(dtTable,aryRows,aryColumns)
Parameter Description
Parameter | Required | Type | Default | Description |
---|---|---|---|---|
dtTable | True | expression | objDatatable | The source datatable to be sliced |
aryRows | True | expression | [] | Line slices of the data, array type, the first element represents the starting line, the last element represents the ending line |
aryColumns | True | expression | [] | 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
*/