Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What's happening here ?
Message
 
 
À
24/02/2005 13:15:01
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:
00990236
Vues:
20
FYI,

The code that creates and assigns an object to a property in a class definition is invalid in VFP9. It generates error "Statement is not valid in a class definition". It has to be changed to
DEFINE CLASS c1 AS CUSTOM
  o = Null
  PROCEDURE Init
    This.o = CREATEOBJECT("c2")
  PROCEDURE Destroy
    This.o = Null

ENDDEFINE
>
>x = CREATEOBJECT("c1")
>x = .NULL.
>
>DEFINE CLASS c1 AS CUSTOM
>  o = CREATEOBJECT("c2")
>ENDDEFINE
>
>DEFINE CLASS c2 AS CUSTOM
>  PROCEDURE INIT()
>    =MESSAGEBOX("C2 Init")
>  ENDPROC
>  PROCEDURE DESTROY()
>    =MESSAGEBOX("C2 Destroy")
>  ENDPROC
>ENDDEFINE
>
>
>I know the c1 class code is a bit suspect but why doesn't the instance of c2 get released ?
>
>Regards,
>Viv
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform