The following code demostrate a bug that i discover sometime ago in VFp7 & 6 ...
The bug involve two classes that have the same name but are in two different class-container, when this classes are used for subclassing in the same work-session without issuing a CLEAR ALL between the operation, VFP act a "classMerging".
I supposed that VFP in his cache, when try to reuse the cached classes, performs erroneous searches.
Can, Anyone that have VFP8.0 Beta, try this code for me, and say me if the problem persist ?
Thanx in Advance
** Cut Here
IF !FILE('sub\b2.vcx')
cProg = SYS(16)
DO makeclasses IN &cProg
ENDIF
cProg = SYS(16)
DO checkclasses IN &cProg
RETURN
PROCEDURE makeclasses
MESSAGEBOX("To the class which appears, add a label with caption 'class 1', fontsize 24 and AutoSize = .T. then save the class", 0, "Class Problem")
CREATE CLASS baseform OF classes AS FORM
CLEAR ALL
MESSAGEBOX("Save the following class as is", 0, "Class Problem")
CREATE CLASS BASE OF base1 AS baseform FROM classes
CLEAR ALL
MESSAGEBOX("Change the caption of the next classes label to 'class 2'", 0, "Class Problem")
CREATE CLASS BASE OF base2 AS baseform FROM classes
CLEAR ALL
MESSAGEBOX("Save the following class as is", 0, "Class Problem")
CREATE CLASS SubBASE1 OF b1 AS BASE FROM base1
CLEAR ALL
MESSAGEBOX("Save the following class as is", 0, "Class Problem")
CREATE CLASS SubBASE2 OF b2 AS BASE FROM base2
CLEAR ALL
ENDPROC
PROCEDURE checkclasses
MODIFY CLASS SubBASE1 OF b1 NOWAIT
MESSAGEBOX("sub class b1: you should see 'class 1'", 0, "Class Problem")
CLOSE ALL
MODIFY CLASS SubBASE2 OF b2 NOWAIT
MESSAGEBOX("sub class b2: you should see 'class 2'", 0, "Class Problem")
CLOSE ALL
MODIFY CLASS SubBASE1 OF b1 NOWAIT
MESSAGEBOX("back to sub class b1: you should see 'class 1' but you see 'class 2'", 0, "Class Problem")
CLOSE ALL
CLEAR ALL
MODIFY CLASS SubBASE1 OF b1 NOWAIT
MESSAGEBOX("back to sub class b1: you should see 'class 1' and you see 'class 1' because CLEAR ALL was issued", 0, "Class Problem")
CLOSE ALL
ENDPROC
** Cut Here
bye, Emanuele!
In the beginning the Universe was created.
This has made a lot of people very angry and been widely regarded as a bad move.