sortwith array for containercontrol array?

been running into a few problems latly.
can anyone help please…

i have an array of a containercontrol i made.
now i have another array i want to sort it by.

usually i go myarray.sortwith(mysortarray)
but the sortwith is not available like it normally is.

is there a way to sort my array of containercontrols? i simply want to move some down and then one up in the index.

since you are referring to your container control “group” as an array, I assume you are using an older version of RealStudio and not Xojo. Control “arrays” were never really arrays at all and in Xojo they are referred to as “sets”. That is why you are not finding the array methods you are expecting. What are you trying to accomplish by changing the index of your arrays? Maybe there is a better way.

i am using the latest version.
i have a pagepanel in which i have embedded my containercontrol, i have added them to the array/set so i can easily access them.
and they keep the same index in the array/set as they do on the pagepanel.value so it is easy.
pagepanel.value=2 is the same as mycontrols(2)
no i have added a feature to rearange the pagepanel, so say number 4 becomes number 2 and pushes the ones after 2 up one.
with that done i now need to rearrange the array/set

since it IS a real array you can use sort with
the question is more what should the key values be to do the sorting

How does ht user designate that they want to move page 4 to page 2 (for instance) ?
It might be best to simple swap the items in your array that is the containers right then

i tried using sortwith but it is not available, the swapping of the pagepanel panels has been coded already and working fine.
i can’t remove and re add the items to the control array as that will lose there link the the actual containercontrol embbeded within the pagepanels.

ah you’re trying to do

mycontainers.sortwith someotherarray

?

yes that won’t work BUT an array of integers that you do

integerarray.sortwith mycontainers

will

i can’t sort the pagepanel with the containerarray as from what i can see i can never rearange the containerarray so it’s always going to be the same.

simply i want to rearrange a containercontrol without removing and readding the items. anyknow know if this is possible?

i am a twat.
i had it the wrong way around. integerarray.sortwith mycontainers does work.
i am use to another language where the array to be sorted is first.

i feel so stupid. thanks for helping me see the light guys.

on another note. anyone know why i can use .tabpanelindex on a contrainercontrol embedded within a pagepanel to change the page it is on and it works fine but there is no .panelindex to be able to change it?

well because once its ON a page in the page panel you cannot just move it to another page

implementation details but thats why

you can move any other control to other pages.
and tabpageindex seems to work perfectly fine as far as i can see. no problems found with it so far.