OrderedCollection

Ned Konz ned at bike-nomad.com
Sat Dec 8 01:00:43 UTC 2001


On Friday 07 December 2001 04:04 pm, James Stark wrote:
> Hi,
>
> I have an OrderedCollection of Records - Records having variables
> familyname(string), firstname(string), age(int), height(float).  I read in
> from a file of the following format:
>
> familyname, firstname, age, height
> REPEATED
>
>
> I read in the lines, and store them in my record, then add them to my
> orderedcollection.
>
> The question is:  how do I access the methods of the objects in the
> OrderedCollection?
>
> Since when I make mylist an OrderedCollection
> I cant access methods of record using something like:
>
> (mylist at: 1) familyname printNl !
>
> WHERE
>
> record familyname printNl! would work!

Why can't you? If your OC (which I assume is assigned to a variable somewhere 
(not in Record!)) has records in it, you can call methods exactly as you 
describe.

That is, if
    record familyname printNl
works, and
    (mylist at: 1)
returns the same object that record refers to,
why wouldn't
    (mylist at: 1) familyname printNl
work? Perhaps I'm missing something...

-- 
Ned Konz
currently: Stanwood, WA
email:     ned at bike-nomad.com
homepage:  http://bike-nomad.com




More information about the Squeak-dev mailing list