Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is this Normal?
Message
From
22/11/2000 05:03:54
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Title:
Is this Normal?
Miscellaneous
Thread ID:
00444512
Message ID:
00444512
Views:
26
Dear all,

I would like to know the behaviour why a form is initialised differenty via a DO FORM statement verses a CreateObject?. The follow simple example would be able to simulated the problem.

1) Create a form with a pageframe and in page one place two text box. In the second textbox, in the INIT method have this line of code

THISFORM.PAGEFRAME1.PAGE1.Text1.Value='1234'

Run the form

2)Save this form as a class. Now Try to initialise the form via CreateObject().

The second instance failed because in the INIT method. If I replace the code with THIS.PARENT.Text1.Value="1234", it works. Also in this case the sequence in which the object is created is also important. Whereas with the DO FORM method this is not important.

From my observation, It seems that with the DO FORM all the objects are first created and then the INIT are then called. With Class, object is created and then INIT is called immediately. I would like to know if this is behaviour by design or a bug. I would like to hear suggestion as to how best as to avoid this problem, in another words best practice approach.

I have VFP6 with SP4 and the same problem occurs in W2K as well as Win98. Thanks.

Regards,
Kueh.
Next
Reply
Map
View

Click here to load this message in the networking platform