Labtalk command to reorder columns in worksheet


Version: 2023b

Type: Features

Category: Programming

Subcategory: LabTalk

Jira: ORG-26469


arg1 = -1: reverse current order

arg1 = column index, arg2 is its new index, similar to layer.Reorder(From, To)

arg1 = dataset, no arg2: allow for complete control, similar to OC Worksheet::ReorderColumns

Examples:

wks.reorder(2,5) //moves 2nd column to be the 5th column
wks.reorder(2, 0) //moves 2nd column to be the last column
wks.reorder(2,-1) //moves 2nd column to be next-to-last column
wks.reorder(0, -1) //moves the last column to be next-to-last column
wks.reorder(-1, 1) //moves next-to-last column to be the first column

//to swap 2nd column and 4th, use
dataset vv = {1,4,3,2};
wks.reorder(vv);