comparing objects in a collection

Janet Abdul-Karim jn_karim at
Mon Feb 3 03:19:06 UTC 2003

I am trying to find a certain value in a collection.  does something if true or does something if false and for some reason it always evaluates to false and I know its there.  Any help would be great

sample code.

findAccount: accountNumber
 "Find the account with the argument number"

 self do:[:element | element number == accountNumber 
  ifTrue:([Transcript show: element;cr])
  ifFalse:([Transcript show: 'No such account exists in this portfolio';cr])].

element is an object that has number as a method 


Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now
-------------- next part --------------
An HTML attachment was scrubbed...

More information about the Squeak-dev mailing list