Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What's happening here ?
Message
De
25/02/2005 03:42:42
 
 
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:
00990434
Vues:
17
Hi,

>>
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
>>

I knew the syntax I used was 'sus' but I was surprised at the result. BTW, why bother with the 'This.o=Null' - when wouldn't o go out of scope when c1 is destroyed anyway ?

Also I see that although VFP9 (at least in the beta) flags up the error it only does so AFTER creating c2 and is inconsistent in subsequently releasing it.

Regards,
Viv
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform