M Mostez Well-Known Member Licensed User Longtime User Jun 11, 2021 #1 I have two unsorted lists, FieldsNames that contains elements (for example B,D,A,C) and empty list tmpFiledsNames, both of them are declared in the same activity SQLmaker B4X: Copy Public FieldsNames As List this code to set the list (from another activity) B4X: Copy SQLmaker.FieldsNames = St.TableColumns I use this code to temp store sorted version of FieldsNames, but when I do that, I get both lists sorted! both lists contain (A,B,C,D) B4X: Copy Dim tmpFiledsNames As List = FieldsNames tmpFiledsNames.Sort(True) I'd like to know how to keep the original one FieldsNames as it is without sorting after sorting the other one TIA
I have two unsorted lists, FieldsNames that contains elements (for example B,D,A,C) and empty list tmpFiledsNames, both of them are declared in the same activity SQLmaker B4X: Copy Public FieldsNames As List this code to set the list (from another activity) B4X: Copy SQLmaker.FieldsNames = St.TableColumns I use this code to temp store sorted version of FieldsNames, but when I do that, I get both lists sorted! both lists contain (A,B,C,D) B4X: Copy Dim tmpFiledsNames As List = FieldsNames tmpFiledsNames.Sort(True) I'd like to know how to keep the original one FieldsNames as it is without sorting after sorting the other one TIA
A arfprogramas Member Licensed User Longtime User Jun 11, 2021 #2 B4X: Copy Dim tmpFiledsNames As List tmpFiledsNames.Initialize tmpFiledsNames.AddAll(FieldsNames) tmpFiledsNames.Sort(True) Upvote 0
B4X: Copy Dim tmpFiledsNames As List tmpFiledsNames.Initialize tmpFiledsNames.AddAll(FieldsNames) tmpFiledsNames.Sort(True)