Problems with Collection again.

Janet Abdul-Karim jn_karim at
Tue Feb 4 01:15:34 UTC 2003

I made an instance of collection and trying to print out what is in the collection.  The way I coded seems to only print out the last obect that I added.



portfolio: aAccount

portfolio:= SortedCollection new.

portfolio sortBlock:[:x :y | x name < y name].

portfolio add: aAccount.

code to print portfolio

portfolio isNil ifTrue:[Transcript show: 'Portfolio empty'].

ifFalse:[portfolio do:[:element | Transcript show: element name]].

***if you are wondering y i did not use isEmpty instead I tried and it was giving me errors turned out isNil worked just fine.  That fact that I could not use isEmpty make me wonder is porfolio is really a collection.***


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