Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What's happening here ?
Message
De
26/02/2005 12:16:09
 
 
À
26/02/2005 10:15:52
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows 2000 SP4
Divers
Thread ID:
00990234
Message ID:
00990884
Vues:
14
>Hi,
>
>Even odder. So:
>
>CLEAR
>x = CREATEOBJECT("c1")
>x.o = .NULL.  && Does nothing
>x = .NULL.   && Fires C1.Destroy() but it's still there
>? "RELEASE THE CLASS FROM MEMORY"
>CLEAR CLASS c1 && this relase the class memory image
>
>
>DEFINE CLASS c1 AS CUSTOM
>  o = CREATEOBJECT("c2") && this put a c2 reference into the C1 class MEMORY image
>  PROCEDURE DESTROY()
>    ? "C1 Destroy"
>  ENDPROC
>ENDDEFINE
>
>DEFINE CLASS c2 AS CUSTOM
>  PROCEDURE INIT()
>    ? "C2 Init"
>  ENDPROC
>  PROCEDURE DESTROY()
>    ? "C2 Destroy"
>  ENDPROC
>ENDDEFINE
>
>
>Regards,
>Viv

Viv, odder ?
When you define a property at class definition level,
it is evaluated and filled ( into the class image , not into the object ) one time only;
after VFP copy the class image properties into the class instance ( the object ).
For properties objects there is a bug,
and VFP it confuses these with the members objects ( ADD OBJECT ... )

This can to be done into VFP9 with 3-4 more code lines.

Fabio

<
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform