Page 1 of 1

get the keys of an array

Posted: Fri Apr 05, 2013 6:38 pm
by jmburnod
Hi All,
I have to choose between two methods to classify a list of png files like this:

Code: Select all

size,image1.png,image2.png,image…
Methode 1
Use the size of file as number of the currentline in a loop

Methode 2
Use the size of file as name of array key in a loop

Methode 2 is faster than Methode 1 but i read "keys of tarray" is desktop only

Is there a way to get the keys of an array on IOS ?

Best regards
Jean-Marc

Re: get the keys of an array

Posted: Fri Apr 05, 2013 6:50 pm
by sturgis
Use element instead. SHould work.

Re: get the keys of an array

Posted: Sat Apr 06, 2013 9:02 am
by jmburnod
Hi Sturgis,

Thanks for your reply

Code: Select all

 put the keys of gDataA into tK
work fine

Code: Select all

put the elements of gDataA into tK
return an error (Expression: bad factor)
Kind regards
Jean-Marc

Re: get the keys of an array

Posted: Sat Apr 06, 2013 2:15 pm
by sturgis
Hmm. DOH, I misread it. It works with the values not the keys. DOH.

I'm thinking, surely the array stuff has been updated to include IOS and android. Have you tested getting the keys on a device? The dictionary has been known to be wrong once in a while.

Re: get the keys of an array

Posted: Tue Apr 09, 2013 3:39 pm
by jmburnod
Thank for the doubt about dictionary :D
The dictionary has been known to be wrong once in a while.
You're right. I tested on my iPad

Code: Select all

get the keys of myArray 
work fine
Does someone can confirm it work with androïd ?
Best
Jean-Marc

Re: get the keys of an array

Posted: Tue Apr 09, 2013 4:18 pm
by sturgis
Yep, android is fine too.

Re: get the keys of an array

Posted: Tue Apr 09, 2013 4:25 pm
by jmburnod
Great !
I put a comment in the Dictionary User notes