Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Benefits to create object -vs- do form
Message
From
27/08/2000 18:52:00
 
 
To
23/08/2000 13:01:28
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00408330
Message ID:
00409656
Views:
20
Alan

I have been watching this thread with interest. So far, I am able to ascertain two things:

1) I, as a NEW VFP, understand the dynamics of the question and have asked myself many times the same question.
2) There will never be a definitive answer on this question.

I have often thought of it as this:

When I need a form to manipulate data DIRECT, I use the "DO FORM". Why? Because of my project I have many database tables open . I use the form DataEnvironment to open the tables and the DO FORM to set some specifics. Sort-of a data environment class - but not quite. There are many variances to my data requirements so I am at a point where I cannot drill down further.

When I need a form which extracts, displays, or edits data INDIRECT I use CREATE OBJECT. MY RULE is: I have an instance of form called with DO FORM. This form will handle all of the READ/WRITE requirements to the desired tables. One of the members is a memo field - yet I only want to work with the memo contents when called because of screen size limits. I have the form pass the memo value to my "MEMO CLASS" and create the memo class object. On release of the memo class object, I return the new memo contents back to the calling form to handle read/write processes. This is much faster than the DO FORM in that I have no overhead on environments, extra methods which are not needed, etc.

This is only my opinion - but it is a rule which has helped me immensely. There are counters to this argument, such as a public data session, etc. But I feel comfortable following this rule set. Find something you are comfortable with. Check the FAQ/articles as well. Good to see another "NEWBIE" to the VFP world here and good luck.
HTH.

Ric

NB: Some part of this thread went astray on programming classes vs. class designer, etc... This is not relevant to you primary question.
Previous
Reply
Map
View

Click here to load this message in the networking platform