Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What's happening here ?
Message
 
 
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows 2000 SP4
Miscellaneous
Thread ID:
00990234
Message ID:
00990236
Views:
18
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--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform