Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Any reason to not use NewObject in form.Load()
Message
From
27/06/2003 10:46:09
 
 
To
20/06/2003 18:18:00
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00802482
Message ID:
00804687
Views:
36
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform