Hi all

Working in classic ASP: I have a parent class "clsCountry" and I want to have a sub-class "clsRegions" which will be a property of clsCountry. Probably then a further sub-class "clsRegionDetails" which would be a property of clsRegions.

In some instances a country will only have one "region" and in other instances there may be up to 10. What's the most logical way to organise this?

I would imagine it working like this:

response.write clsCountry.regions.region1.regionDetails.name
response.write clsCountry.regions.region1.regionDetails.description
if clsCountry.regions.region2.regionDetails.name<>"" then
 response.write clsCountry.regions.region2.regionDetails.name
 response.write clsCountry.regions.region2.regionDetails.description
end if
if clsCountry.regions.region3.regionDetails.name<>"" then
 response.write clsCountry.regions.region3.regionDetails.name
 response.write clsCountry.regions.region3.regionDetails.description
end if

etc, etc...

OR.. Should clsRegions have a property that holds the number of Regions for the current country?
eg.
for i = 1 to clsCountry.Regions.totalRegions
lvstrRegion = clsCountry.regions.region&i
response.write eval(lvstrRegion.regionDetails.name)
response.write eval(lvstrRegion.regionDetails.description)
next


I'd be interested to hear how others would approach this. When creating clsRegions, would you hard code in a number of region properties that is expected to be greater than requirements? Or is there a smarter way to do it dynamically?

Thoughts much appreciated,

Clancy

_________________________________________________________________
Surf the net and talk on the phone with Xtra JetStream @ http://xtra.co.nz/jetstream



____ • The WDVL Discussion List from WDVL.COM • ____ To Join wdvltalk, Send An Email To: mailto:[EMAIL PROTECTED] or use the web interface http://e-newsletters.internet.com/discussionlists.html/ Send Your Posts To: [EMAIL PROTECTED] To change subscription settings or add a password: http://intm-dl.sparklist.com/read/?forum=wdvltalk

________________  http://www.wdvl.com  _______________________

You are currently subscribed to wdvltalk as: archive@jab.org
To unsubscribe send a blank email to [EMAIL PROTECTED]

To unsubscribe via postal mail, please contact us at:
Jupitermedia Corp.
Attn: Discussion List Management
475 Park Avenue South
New York, NY 10016

Please include the email address which you have been contacted with.



Reply via email to