This could be something really simple and I'm having a moment, but i've a list of IDs, names and scores in a data grid and i'm trying to pull out the list sorted so that it can be pushed to a graphics machine via AMCP commands.
I've got the data grid sorting perfectly, however when I try to pull out the data, it's not actually sorting it.
It's still sorting by IDs despite wanting to sort via codes. You have the data grid sorted, but the exported info is just as it was originally entered the first time around.
Code: Select all
on mouseUp pBtnNum
set the dgProps["sort by column"] of group "dgResults" to "Time"
if pBtnNum is 1 then
put the dgData of group "dgResults" into theData
sort lines of it by theData[each]
put theData[1]["Number"] into field "carnumber1"
put theData[1]["Name"] into field "carname1"
put theData[1]["Time"] into field "cartime1"
put theData[2]["Number"] into field "carnumber2"
put theData[2]["Name"] into field "carname2"
put theData[2]["Time"] into field "cartime2"
end if
end mouseUp
So visually it's sorting, but theData which is being pulled out is not in the right order. It could be something really simple, but I'd have thought what was visually listed in the grid is what would be spat out by the above in the order it's shown?