Collection & IndexOf()


I have this code and I do not understand what is wrong with “$MyColl.indexOf($ToSearch;0)”

<code 4D>
Case of
: (Form event=On Load)
Form.lesfactures:=ds.Factures.query(“Statut = :1”;“4”).orderBy(“DateEmission desc”)
Form.codedecontrole:=ds.XData.query(“XNom = :1”;“Checksum”).orderBy(“XDate desc”)

	$MyColl:=New collection
	For each ($Entity;Form.lesfactures)
		$MyColl.push(New object("checksum";$Entity.Checksum;"correct";False))
	End for each 
	For each ($Entity;Form.codedecontrole)
		If ($n>=0)
		End if 
	End for each 

End case

</code 4D>

During execution, I got always $n=-1, and the variable $ToSearch contains the right information to look for. What am I doing wrong?

[]25419838;“Your comment here…”[/]