> Le 20 août 2016 à 21:57, Alan Tilson <[email protected]> a écrit :
> 
> Hello again Alan,
> Removing the third parameter seems to fix things!
> Thanks for catching that one. I must have carried it over from Find in
> Array, which does have an optional 3rd parameter.

It's useful when you use the 0 index of the array:

+++
ARRAY LONGINT($_al;0)
$_al{0}:=1
$nbRows_l:=3
For ($i_l;1;$nbRows_l)
        APPEND TO ARRAY($_al;$i_l%2)
End for 

ASSERT(Find in array($_al;1)=1)
ASSERT(Find in array($_al;0)=2)
ASSERT(Find in array($_al;1;0)=0)  //starting from 0 is allowed

ASSERT(Count in array($_al;1)=2)  //0 not considered
+++

From the last line of the code above, the 0 index is not considered by the 
'Count in array' function. 
Displaying 'Count in array($_al;1;Random)' in debugger shows the undocumented 
3rd parameter must be avoided. 

-- 
Arnaud de Montard 


**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[email protected]
**********************************************************************

Reply via email to