Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
With thisform - we ain't got no stinkin' ...
Message
 
 
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 7
OS:
Windows XP SP2
Miscellaneous
Thread ID:
00955711
Message ID:
00955858
Views:
14
Terry, that is the weirdest thing. It's like you can temporarily make a class associated with another object, even in cases where THISFORM would not work at all.

This is a bit different from your situation; you've used THISFORM elsewhere in the method, so your object is instantiated in the context of the form already.

But in the following example, a use of THISFORM would fail, and yet the .* references do work.

I think that's strange...

>L<
ox = CREATEOBJECT("myform")
ox.show(1)

DEFINE CLASS myform AS Form
  ADD OBJECT x AS CommandButton
  PROCEDURE x.Click
     WITH THISFORM
       oy = CREATEOBJECT("myclass")
       oy.DoIt()
     ENDWITH
  ENDPROC
ENDDEFINE  

DEFINE CLASS myclass as Custom
  PROCEDURE DoIt()
    WAIT WINDOW .Caption
    WAIT WINDOW .WindowState
    * WAIT WINDOW THISFORM.Caption would fail
    * with the appropriate error: 
    * object is not contained in a form.
  ENDPROC
ENDDEFINE
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform