FIX: Inherited Code Fires Twice with DODEFAULT()Last reviewed: October 29, 1997Article ID: Q158250 |
The information in this article applies to:
SYMPTOMSWhen the DODEFAULT() function is used in a subclass method, it executes a method in the parent with the same name. When the parent has no method with that name, it then looks to the grandparent for that method. If it exists, it is executed. If the grandparent has a NODEFAULT() function, the code gets executed twice.
CAUSEThe parent in the above situation executes the code of the grandparent as its own. Because the grandparent has a NODEFAULT() function, the parent calls the method of the grandparent again.
WORKAROUNDTo work around this problem, place a method that has the same name in the parent. Place a DODEFAULT() command in the parent method.
STATUSThis behavior is by design in the products listed at the beginning of this article. This behavior does not occur in Visual FoxPro 5.0a
MORE INFORMATION
Steps to Reproduce Behavior
DEFINE CLASS test2 AS test1 PROCEDURE Load DODEFAULT() ENDPROC ENDDEFINEThe above code prevents Class test2 from running class test1's code as its own. Keywords : FxprgClassoop vfoxwin vfpfix5.0a kbprg kbbuglist kbfixlist Version : 5.0 Platform : WINDOWS Issue type : kbbug Solution Type : kbfix |
================================================================================
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |