• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Object inheritance question...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Object inheritance question...


  • Subject: Object inheritance question...
  • From: Brendan Wilde <email@hidden>
  • Date: Mon, 26 Sep 2005 17:01:54 +1000

I have a basic understanding of objects but i am having problems with a concept can someone point
me in the right direction, refer to below... I want to pick which object my new objects inherit from, at the moment i can only make objects inherit from a single parent, but need to have a variable amount of parents and then various children off each. For example 5 "street" objects each with various "house" objects.
So how do i make a "house" for my new street object that inherits all of streets variables and methods etc?
An example would be great. Thanks Brendan...

script street
property streetName : "Main"
display dialog "I am " & streetName & " Street and I want a house too!"
on x)
set streetName to x
end setName
on getName()
return streetName
end getName
end script

script house
property parent : street
display dialog "I am a house on " & getName() & " Street."
end script

run house

copy street to secondStreet
tell secondStreet
setName("Second")
run
end tell
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Object inheritance question...
      • From: Brennan <email@hidden>
    • Re: Object inheritance question...
      • From: Simon Forster <email@hidden>
  • Prev by Date: Re: Tip for easy editing of droplets
  • Next by Date: Re: Object inheritance question...
  • Previous by thread: Re: Mail and Attachments
  • Next by thread: Re: Object inheritance question...
  • Index(es):
    • Date
    • Thread