On Oct 3, 2006, at 11:42 AM, Phil M wrote:

On Oct 3, 2006, at 9:23 AM, Kevin Windham wrote:

Is there a smart way to access an object and it's properties from a string.

Suppose I have an object of class Car and properties of weight and maxSpeed. If I read in a config file that has some config parameters for this car,

weight: 5000
maxSpeed: 248

along with a whole bunch of other parameters, is there a decent way to set up my code to fill those parameters in without using a bunch of case of if statements?

What you could do is add two methods: Serialize() As String, Deserialize(data As String)

As long as you have both methods with the data in the same order, you will be able to read/write the object properties. Here are examples of the two methods (using REALbasic 2006)

I don't think this applies really since I may need to access these values in any order, or from various places that would set the values.

Thanks though,
Kevin
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

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

Reply via email to