Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Is this Normal?
Message
De
22/11/2000 05:03:54
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Titre:
Is this Normal?
Divers
Thread ID:
00444512
Message ID:
00444512
Vues:
30
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.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform