Lasso Soft Inc. > Home

[ array->keys ]

Method

Returns a staticarray containing each element position.

  • Syntax
array->keys
Examples
  • Beginner

Gat an array of the element positions of an array

This example uses the [array->keys] method to output a comparison of two arrays.

Code

var( DaysOfWeek = array('Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'),
     JoursDuSemaine = array('Dim', 'Lun', 'Mar', 'Mer', 'Jeu', 'Ven', 'Sam') )

iterate($DaysOfWeek->keys) => {^
     $DaysOfWeek->get(loop_value)+' = '+$JoursDuSemaine->get(loop_value)+'\n'
^}

Result

Sun = Dim
Mon = Lun
Tue = Mar
Wed = Mer
Thu = Jeu
Fri = Ven
Sat = Sam

Recent Comments

No Comments found

Please note that periodically LassoSoft will go through the notes and may incorporate information from them into the documentation. Any submission here gives LassoSoft a non-exclusive license and will be made available in various formats to the Lasso community.

LassoSoft Inc. > Home

 

 

©LassoSoft Inc 2014 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft