Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sorry to be such a Dullard!
Message
From
26/07/2010 09:20:43
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
25/07/2010 21:22:10
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
01473802
Message ID:
01473883
Views:
79
This message has been marked as a message which has helped to the initial question of the thread.
>What variable, value or condition do I check to check the existence of "ThisForm.OtherForm"? I want to make sure the new form is closed before it is called again, because the form creates a cursor to populate the data, and the initial cursor would be destroyed thus causing a problem when returning to the first open instance. Is there a conditional statement to test before issuing ThisForm.OtherForm.Release() ?

You might also check if type("ThisForm.OtherForm") = "O". After instantiating the form, the type of the reference will be "O" (Object), but after destroying the form, it will be of type "U" (unknown).

On the other hand, cursors in one form should not interfere with cursors in another form. Each form, and especially each data-handling form, should use a private datasession (Form.DataSession = 2 - private).

In this case, I would still recommend only one child form per parent form, but only for organizational purposes.

>This could also be applied when closing the first form as well (if I follow your discussion with Naomi).

If you do have any problem (I am not quite sure of this), you could also set the property reference to NULL: ThisForm.OtherForm = NULL. If the form was created with the LINKED keyword, that should automatically close the other form.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform