Multiple inheritance and qualification

Report bugs and possible workarounds for ANSI TD versions
Dave Rabelink
Founder/Site Admin
Founder/Site Admin
Posts: 3384
Joined: 24 Feb 2017, 09:12
Location: Gouda, The Netherlands

Multiple inheritance and qualification

Post by Dave Rabelink » 24 Aug 2012, 07:33

This seems to be a very old issue.
I found this during porting from TD15 to TD61 in the case that the sequence of the classes in the "Derived from" section are switched.

Situation, see screenshot
(click to expand)

There are two base classes, each having one instance variable.
There is a class which derives from those two base classes.

To set and get the value of the two instance variables you do for instance:

Code: Select all

Set nMyMode = 1234
Set nMyDummy = 9000
A valid qualification for the point of view of an instance of the third class is:

Code: Select all

At least, I expected this to be !

But it depends on the sequence of the classes in the derive from section.

When class ClsDlgBase_Mode is the first item in the section, the qualification to this class is ok.
But then the other qualification to class ClsDlgBase_Dummy will fail.
In the case of the example, the variable nMyDummy has the same value of nMyMode !!!

When switching the sequence of the classes in derived from, the issue is the other way around.
Then nMyMode will have the value set on nMyDummy !!

See screenshot:
IMHO this is wrong.

I post this (even when this issue is found on TD15 up to TD61) to have this designated as defect.
But also to show others that this issue is present and be aware of this.

So it could be fixed or at least mentioned in the documentation on qualification.
When not aware you can get unpredictable results and look for the reason which has cost me quite some time to find.

Use testcase:

- run and see the values for the both variables
- switch the classes in de defived from section
- comment the instance of the dialog and uncomment it (to force recompilation)
- run and see that the issue for the variables is the other way around.
Testcase is in TD15 format to be used in all TD versions.
You do not have the required permissions to view the files attached to this post.
Dave Rabelink

Articles and information on Team Developer Tips & Tricks Wiki
Download samples, documents and resources from TD Sample Vault
Videos on TDWiki YouTube Channel

Return to “Bug Reports (TD 4.2 and older)”

Who is online

Users browsing this forum: [Ccbot] and 1 guest