Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
With thisform - we ain't got no stinkin' ...
Message
 
 
À
29/10/2004 05:26:25
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 7
OS:
Windows XP SP2
Divers
Thread ID:
00955711
Message ID:
00955858
Vues:
16
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform