actionscript 3 - How can I order my string in as3 -


a complex question :

i've got code (not complete code, essentials question, think) :

var $pmm:string; var $pms:string; var $bmm:string; var $bms:string;  function haute1():string { return $pmm; }; function haute2():string { return $pms; } function basse1():string { return $bmm; }; function basse2():string { return $bms; };          accueil.todayhaute_txt.htmltext = haute1;         accueil.todaybasse_txt.htmltext = basse1;         accueil.todayhautesecond_txt.htmltext = haute2;         accueil.todaybassesecond_txt.htmltext = basse2; 

"haute1" hour (in 24h format). "13h25".

it changes everyday.

question : how can put them in ascending order in as3 ?

example : if haute1 = 15h20, haute2= 6h00, basse1= 11h , basse2 = 17h, function put them in order : "haute2", "basse1", "haute1" , "basse2".

thx


edit

i add code have. helping ?

/ assigns hours , tidal heights         $pmm = convdateheure($tpbs[1 + $deltapm]);         $pms = convdateheure($tpbs[3 + $deltapm]);         $bmm = convdateheure($tpbs[2 - $deltapm]);         $bms = convdateheure($tpbs[4 - $deltapm]);  function convdateheure($valeur:number):string {     var $heure:number = math.floor($valeur);     var $minute:number = math.floor(math.floor(($valeur - math.floor($valeur)) * 100) * 0.6);      var hourslabel:string = "", minslabel:string = "";      if ($heure == 24) $heure = 0;   // check if @ 24 hour mark, change 0     if ($heure < 10) hourslabel += "0" + $heure.tostring(); else hourslabel = $heure.tostring();     if ($minute < 10) minslabel += "0" + $minute.tostring(); else minslabel = $minute.tostring();      return hourslabel + ":" + minslabel;  } 

if want order dates written in string format:

one way be, depending on date string format, push them array , sort them strings, read them all.

another way first parse strings date instances, , push date.time property array, sort it, reverse: parse time values sorted array new date instances use date.tostring or similar.


Comments

Popular posts from this blog

php - How to display all orders for a single product showing the most recent first? Woocommerce -

asp.net - How to correctly use QUERY_STRING in ISAPI rewrite? -

angularjs - How restrict admin panel using in backend laravel and admin panel on angular? -