gettingstarted
[Top] [All Lists]

Re: array/dictionary advice needed

To: Getting Started <gettingstarted at lists dot realsoftware dot com>
Subject: Re: array/dictionary advice needed
From: Will Leshner <leshner at ljug dot com>
Date: Mon, 27 Oct 2003 11:03:06 -0800
References: <A647FCC6-08A0-11D8-90CB-000A958557FC at brucemaudesign dot com> <a05300b2dbbc304743d87 at [10 dot 10 dot 13 dot 3]> <E5CC73A5-08AD-11D8-90CB-000A958557FC at brucemaudesign dot com>


Mark Guertin wrote:

Thanks Joe ... is it possible to have multiple ones tho? As in something like :


foo(0)=array{"rowid" => "1","name" => "Mark", "occupation" => "geek"}
foo(1)=array{"rowid" => "2","name" => "Joe", "occupation" => "RB Guy"}


Instead of "array" how about a class called DataRecord (I'm sure you can come 
up with a better name). It would have, say, two properties: mName and mOccupation. And a 
constructor that takes values for the two properties and sets them. Then you could do 
this (where the key is the rowid and not an integer; of course you could put the rowid in 
the class and use the integer as the dictionary key if you wanted to):

foo("1") = new DataRecord("Mark", "geek")
foo("2") = new DataRecord("Joe", "RB Guy")



- - -
Unsubscribe or switch delivery mode:
<http://support.realsoftware.com/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>