Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Thu Jun 05, 2008 10:14 pm   

Damn Delphi!!
 
OK, this should probably be a blog rant, but oh well.

So here's the deal. In CMUD, I have a structure like this:

type
PrefRec = class(Tobject)
AliasRec = class(PrefRec)
VarRec = class(PrefRec)
TriggerRec = class(PrefRec)
ButtonRec = class(PrefRec)
...etc

Now, one of the routines in the main PrefRec class is called XMLValue. It returns a String of the value within VALUE tags when composing the XML export of the setting. This procedure is set as "Virtual" to allow it to be overridden by the child classes. Some classes override this (like VarRec.XMLValue: String; override;) and some don't.

The ButtonRec does *not* override this method. In the main PrefRec class there is a procedure called StartXML that starts the XML export process. It calls the XMLValue routine.

So here's the deal. When it's in a ButtonRec and calls the XMLValue routine, Delphi is somehow calling the VarRec.XMLValue instead of the parent PrefRec.XMLValue.

How is this possible???? VarRec is a completely different class! How can it be calling VarRec.XMLValue when it's currently running in the ButtonRec class? This is impossible! And yet Delphi is doing it for some reason. I've even restarted Delphi and rebuilt CMUD and it still happens. This is driving me completely insane! I HATE stuff like this which is totally impossible. And it ALWAYS happens to be on release day. It's going to cause me to have another nervous breakdown!
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Thu Jun 05, 2008 10:18 pm   
 
OK, I guess posting is always a good way to resolve these kinds of problems. I looked more closely at the ButtonRec class and for some reason it said this:

ButtonRec = class(VarRec)

making ButtonRec a child of the VarRec class instead of the PrefRec class. I have no idea when this happened and I didn't change it myself, so something else in Delphi caused this to change. It certainly wasn't this way in v2.25.

This was just weird.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net