[Question]Yet another question. (Collections)
Karl Ramberg
karl.ramberg at chello.se
Thu May 11 16:26:39 UTC 2000
Thanks for the answer. That helps a little but what I want to do is
when I have a collection of say
col := #('1' '2' '3' '4') asOrderedCollection
numbers := col collect: [ :each | each asNumber ]
Then some code so I end up with a integer with value 1234.
Karl
"Jarvis, Robert P. (Contingent)" wrote:
> > -----Original Message-----
> > From: Karl Ramberg [SMTP:karl.ramberg at chello.se]
> > Sent: Wednesday, May 10, 2000 2:28 PM
> > To: squeak at cs.uiuc.edu
> > Subject: [Question]Yet another question. (Collections)
> >
> > Thanks for all the answers.
> > I learn stuff all the time here :-)
> > Now I got another question.
> >
> > I make a OrderedCollection and I want to display it on the LedMorph. How
> > do I
> > convert the collection into integers?
> >
> Assuming your collection is full of strings or numbers already, as in the
> following:
>
> col := #('123' '456.789' 0) asOrderedCollection
>
> this should give you a collection of matching numbers:
>
> numbers := col collect: [ :each | each asNumber ]
>
> HTH
>
> Bob Jarvis
> Compuware @ Timken
More information about the Squeak-dev
mailing list
|