Re: min() and array

2016-05-06 Thread Sannyasin Brahmanathaswami
Swasti Astu! Be Well ( from my mobile ) On Wed, May 4, 2016 at 12:46 PM -0700, "Paul Dupuis" mailto:p...@researchware.com>> wrote: On 5/4/2016 2:47 PM, Ludovic THEBAULT wrote: > repeat with i=1 to 5 >put 10 + i into tarray[i][v] > end repeat > put min(tarray[v]) You problem is with th

Re: min() and array

2016-05-05 Thread Mike Bonner
Ah cool. Thanks for the array info. In that case, the example above "put min(tArray[i][v]" doesn't work because there are no subkeys of [i]["v"], only a value. In your example tarray["v"] has subkeys which contain values. So in the first case, the only thing min() can see is 15 (the value of [

Re: min() and array

2016-05-05 Thread Richard Gaskin
Mike Bonner wrote: > You're only looking at a single value, so its returning it. D'oh! Yes, now that I've had my coffee that makes perfect sense. > To get the minimum value across array entries you need to iterate > through them. The Dict says: The ability to use an array was introduced i

Re: min() and array

2016-05-05 Thread Mike Bonner
You're only looking at a single value, so its returning it. min(tArray[i][v]) especially right after your loop.. i will be 5, and v being unset is seen as "v" the value that was placed into tArray[i]["v"] was 15. The min of 15 is 15. Even if your v has been set, you'd still be only looking at a s

Re: min() and array

2016-05-05 Thread Richard Gaskin
Ludovic THEBAULT wrote: >> Le 4 mai 2016 à 21:46, Paul Dupuis: >> >> On 5/4/2016 2:47 PM, Ludovic THEBAULT wrote: >>> repeat with i=1 to 5 >>> put 10 + i into tarray[i][v] >>> end repeat >>> put min(tarray[v]) >> >> You problem is with the second index on the array. >> > > Thanks. > > Too bad t

Re: min() and array

2016-05-04 Thread Ludovic THEBAULT
> Le 4 mai 2016 à 21:46, Paul Dupuis a écrit : > > On 5/4/2016 2:47 PM, Ludovic THEBAULT wrote: >> repeat with i=1 to 5 >> put 10 + i into tarray[i][v] >> end repeat >> put min(tarray[v]) > > You problem is with the second index on the array. > Thanks. Too bad that this function don’t work

Re: min() and array

2016-05-04 Thread Paul Dupuis
On 5/4/2016 2:47 PM, Ludovic THEBAULT wrote: > repeat with i=1 to 5 >put 10 + i into tarray[i][v] > end repeat > put min(tarray[v]) You problem is with the second index on the array. repeat with i=1 to 5 put 10 + i into tarray[i] end repeat put min(tarray) works fine. Or repeat

Re: min() and array

2016-05-04 Thread Mark Wieder
Ludovic THEBAULT writes: > It is normal that script return 0 ? > > repeat with i=1 to 5 >put 10 + i into tarray[i][v] > end repeat > put min(tarray[v]) What were you expecting to happen? -- Mark Wieder ahsoftw...@gmail.com ___ use-livecode m

Re: min() and array

2016-05-04 Thread JB
It returns 0 in Revolution. JB > On May 4, 2016, at 11:47 AM, Ludovic THEBAULT > wrote: > > Hello, > > With the new 8.0. > > It is normal that script return 0 ? > > repeat with i=1 to 5 > put 10 + i into tarray[i][v] > end repeat > put min(tarray[v]) > > not tested in any other version.

min() and array

2016-05-04 Thread Ludovic THEBAULT
Hello, With the new 8.0. It is normal that script return 0 ? repeat with i=1 to 5 put 10 + i into tarray[i][v] end repeat put min(tarray[v]) not tested in any other version. Thanks. ___ use-livecode mailing list use-livecode@lists.runrev.com Plea