Delphi and Kylix

Moderators: pritaeas
Number of threads: 7264
Number of posts: 19073

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Simple ownership dilemma Posted by HieiOtaku on 29 Sept 2006 at 3:31 PM
Hello everyone,

I have a simple dilemma. I have a sprite of a particular class which has another sprite defined under it as a public variable I.E...

Tmysprite=class(Tsprite)
Public
othersprite:Tsprite;
end;

I am writing code in a procedure where the scope only refers to othersprite; I cannot seem to reference the "Tmysprite" which it belongs to. I need to reference the owner (I believe that is the technical term?) in order to be successful here.

I have tried using the parent keyword, but the parent of othersprite is the spriteengine under which it was defined. Is there any way to be able to refer to Tmysprite under these conditions?

Thanks for your help.
Report
Re: Simple ownership dilemma Posted by zibadian on 29 Sept 2006 at 5:08 PM
: Hello everyone,
:
: I have a simple dilemma. I have a sprite of a particular class which has another sprite defined under it as a public variable I.E...
:
: Tmysprite=class(Tsprite)
: Public
: othersprite:Tsprite;
: end;
:
: I am writing code in a procedure where the scope only refers to othersprite; I cannot seem to reference the "Tmysprite" which it belongs to. I need to reference the owner (I believe that is the technical term?) in order to be successful here.
:
: I have tried using the parent keyword, but the parent of othersprite is the spriteengine under which it was defined. Is there any way to be able to refer to Tmysprite under these conditions?
:
: Thanks for your help.
:
Othersprite also needs a reference to TMySprite for it to work.



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.