for k := 0 to stgOutput.ColCount do
stgOutput.Cols[k].Clear;
for k := 0 to stgOutput.RowCount do
stgOutput.Rows[k].Clear;
I could think of two ways that learners could be asked to sort 2D arrays.
Sorting according to the parallel one-dimensional array.
For example: If you have a one-dimensional array containing names and a 2D array containing there marks over 4 terms and you need to sort them alphabetically.
Sorting according to a specific column in the 2D array.
For Example: If you are asked to sort the array according to the first mark (i.e. Column) of the 2D array.
Sorting each rows's data
For Example: Sorting the marks of each learner from lowest to highest