Dear guest !

Welcome to Team Developer Community Forum. A place created by the community, for the community !

This is a resource for Q & A and discussion about everything related to OpenText Gupta Team Developer, SqlBase, TD Mobile and Report Builder.
It is the alternative for the OpenText customer forums which can only be accessed with an active support contract.

Please register your account now. It will make you part of the active community.
Also, this guest message will not be displayed for registered users.

As a bonus, registered users have access to the 'Newsgroups' subforum, holding 10 years worth of posts from the good old Gupta newsgroups.

Having an account gives you the opportunity to ask questions and get help from others.
We hope this free gathering will help you and the community getting forward!

Best regards,
The forum site admins.

[ALL TD VERSIONS] Multiple inheritance and qualification

Post found bugs and possible workarounds.
Post Reply
Dave Rabelink
Founder/Site Admin
Posts: 135
Joined: 24 Feb 2017, 09:12
Location: Gouda, The Netherlands

[ALL TD VERSIONS] Multiple inheritance and qualification

Post by Dave Rabelink » 27 Mar 2017, 09:40

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.
Still present in TD7.0

Situation, see screenshot:

SourceCode.png (41.86 KiB) Viewed 88 times

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:

MultipleInheritanceIssue.png (40.25 KiB) Viewed 88 times

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.
(2.9 KiB) Downloaded 4 times

Testcase is in TD15 format to be used in all TD versions.
Dave Rabelink

Join & participate on Team Developer Tips & Tricks Wiki
Download samples from TD Sample Vault
Videos on TDWiki YouTube Channel

Posts: 28
Joined: 07 Mar 2017, 18:52
Location: Fredericton, New Brunswick, Canada

Re: [ALL TD VERSIONS] Multiple inheritance and qualification

Post by Charlie » 27 Mar 2017, 11:21

Excellent sleuthing !!!

I vote for documentation fix.

The last thing I want to see in my code is some well-intentioned fellow code-monkey setting up (using your code sample) "nMyMode" variables in multiple classes in one long class hierarchy, and then having multiple qualified references (in the form window instance) of the various "nMyMode" variables in the various classes of the hierarchy.

Doing that for functions, I completely get (different functions for different circumstances). Doing that for variables gets my eye twitching like Chief Inspector Dreyfus (from the original pink panther series).

Then again, I haven't had my morning caffeine dose yet ...
A little trick to help direct folk from old Gupta forum to this one: Link to post

Post Reply

Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 1 guest