>> So I am going with array since I have never used collections before and even though it seems pretty straight forward from VFP help, I will refrain from starting now.
>
>Why not use a collection ? If it's a keyed collection, think of it as an array where the index is a string
>
>It's well worth investing a bit of time
>
>
> #define METHATABLENAME_INDEXES [IndexTable]
> #define METHATABLENAME_PEOPLE [PeopleTable]
>
> obj = createobject('Collection')
>
> obj.Add('\data\indextable.dbf', METHATABLENAME_INDEXES)
> obj.Add('\data\peopletable.dbf', METHATABLENAME_PEOPLE)
>
>
>
>
> theIndex = obj.GetKey(METHATABLENAME_PEOPLE)
>
> if( empty(m.theIndex))
>
> else
>
> ? obj.Item(m.theIndex)
> endif
>
>
>
>
> try
> theData = obj[METHATABLENAME_PEOPLE]
> ?theData
> catch
>
>
> endtry
>
>
Hi Gregory,
First, thank you for sample code. It does look straight forward. I am not arguing that the collections approach is valid. Aside from my concern for making a mistake in something that I have never used before and breaking an existing application (which I am refactoring), I have the following point. Why is collections (in this particular case of storing a bunch of names) better than array? Array - with the help of an INLCUDE file - can be addressed with "key" names too.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham