Ordenate a Array


#1

I have a array/object created like this:

’ data={ lat : aVeiculos[x].dispositivos[0].posicoes[0].latitude , _
’ lon : aVeiculos[x].dispositivos[0].posicoes[0].longitude , _
’ placa : aVeiculos[x].placa , _
’ cor : aVeiculos[x].cor , _
’ endereco : aVeiculos[x].dispositivos[0].posicoes[0].endereco , _
’ info : cCarroSelecionado , _
’ distancia: cDistancia , _
’ km : nDistancia , _
’ isPerto : False , _
’ icone : encodeURI(“http://fastmobile.info/img/bus.png”) , _
’ espera : txtEspera , _
’ tempo : cTempo _
’ }
’ aAllBus.push(data)

after the fill with elements it´s possible order it by the element km ?

Thanks in advance !


#2

I found a answer, a cool answer :slight_smile:

It works so fine !


#3

There is also this function:

http://wiki.nsbasic.com/Sort

George Henne
NS BASIC Corporation
http://www.nsbasic.com


#4

Sort , how I saw on the docs , don´t do on multidimensional arrays !

Thank you !

RICARDO CASSOLATTO

Business Consultant
sintetik@gmail.com / 21 98196-0504

FastMobile
http://fastmobile.info
http://www.facebook.com/ricardo.cassolatto
https://br.linkedin.com/in/ricardo-cassolato-9ba225


#5

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.