I am running into a problem maintaining the order of selected records in a multi select record list. This is an xdialog form that uses the following lines to define the records to display ....
'load records from external table
Rlist = table.external_record_content_get("crewlist","Emp_Num+\"|\"+Crews+\"|\"+Name+\"|\"+Craft+\"|\"+Equip_Num+\"|\"+Equip_Desc","","Timekeeper = Var->User_ID")
'creates a character array from Rlist temp_count is equal to the number of 'records returned in Rlist.
DIM var_Rlist[temp_count] as c
var_Rlist.initialize(Rlist)
'this is the line in xdialog that displays the multi select record list
Make Crew Selections:| [%M;d;O={@@}%.150,15var_List^#var_Rlist];
'after making my selections and clicking OK I write the selected records to the trace window to make sure that they are in the correct order. The records are ordered correctly in the xdialog form, and selected in the proper sequence.
trace.writeln("ITERATION = "+i+" "+var_List[i])
Below are the results written to the trace window...
ITERATION = 1 17331 Crew3 Mike Jones R1 2005 A-Frame
ITERATION = 2 11752 Crew1 Ignacio Rivera R1 11060 MUT Truck
ITERATION = 3 11752 Crew1 R1 TRI Tri-Monitor
ITERATION = 4 11752 Crew1 R1 C12 12" Cold Cutters
ITERATION = 5 11752 Crew1 R1 24002
ITERATION = 6 811202 Crew1 Lynn Thomas R2
ITERATION = 7 16710 Crew2 Ruben Bega R1 2581 A-Frame
ITERATION = 8 16710 Crew2 R1 TRI Tri-Monitor
ITERATION = 9 16710 Crew2 R1 C12 12" Cold Cutters
ITERATION = 10 816292 Crew2 Raul Castro Jr. R2
Iteration 1 is the last record that was selected, but all the rest are in the proper order as selected from first to last. Iteration 1 shows that it was the first to be selected but actually was last, there in is where my problem lies. I need to keep these in the order that they are selected....
Thanks to anyone who can give me some insight on what is happening here that puts the last record selected as the first.
Doug
'load records from external table
Rlist = table.external_record_content_get("crewlist","Emp_Num+\"|\"+Crews+\"|\"+Name+\"|\"+Craft+\"|\"+Equip_Num+\"|\"+Equip_Desc","","Timekeeper = Var->User_ID")
'creates a character array from Rlist temp_count is equal to the number of 'records returned in Rlist.
DIM var_Rlist[temp_count] as c
var_Rlist.initialize(Rlist)
'this is the line in xdialog that displays the multi select record list
Make Crew Selections:| [%M;d;O={@@}%.150,15var_List^#var_Rlist];
'after making my selections and clicking OK I write the selected records to the trace window to make sure that they are in the correct order. The records are ordered correctly in the xdialog form, and selected in the proper sequence.
trace.writeln("ITERATION = "+i+" "+var_List[i])
Below are the results written to the trace window...
ITERATION = 1 17331 Crew3 Mike Jones R1 2005 A-Frame
ITERATION = 2 11752 Crew1 Ignacio Rivera R1 11060 MUT Truck
ITERATION = 3 11752 Crew1 R1 TRI Tri-Monitor
ITERATION = 4 11752 Crew1 R1 C12 12" Cold Cutters
ITERATION = 5 11752 Crew1 R1 24002
ITERATION = 6 811202 Crew1 Lynn Thomas R2
ITERATION = 7 16710 Crew2 Ruben Bega R1 2581 A-Frame
ITERATION = 8 16710 Crew2 R1 TRI Tri-Monitor
ITERATION = 9 16710 Crew2 R1 C12 12" Cold Cutters
ITERATION = 10 816292 Crew2 Raul Castro Jr. R2
Iteration 1 is the last record that was selected, but all the rest are in the proper order as selected from first to last. Iteration 1 shows that it was the first to be selected but actually was last, there in is where my problem lies. I need to keep these in the order that they are selected....
Thanks to anyone who can give me some insight on what is happening here that puts the last record selected as the first.
Doug