Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Any reason to not use NewObject in form.Load()
Message
De
27/06/2003 10:46:09
 
 
À
20/06/2003 18:18:00
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00802482
Message ID:
00804687
Vues:
37
Hi Bill,

>
>form.load()
>  if !dodefault()
>    return .f.
>  endif
>  this.NewObject('myName','myClass')
>  return this.myName.myMethod()
>
>Is there any reason I should not add an object to a form in the Load() method?

Other than that the form object doesn't have a NewObject method and the code above won't run, I can't think of any *bg*
If you have no need of the "myClass" object other than to determine whether the form should load or not you want
LOCAL loX
lox = NewObject("myName", "myClass")
RETURN lox.myMethod()
If you want to use methods of myClass at other times during the life of your form then you want to use AddObject.
This.AddObject("myName", "myClass")
pamela
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform