Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to distinguish between a single form and a formset 1

Status
Not open for further replies.

german12

Programmer
Nov 12, 2001
563
DE
Hi,

I want to create a standard-form which shall be stored as a class.
Thisform shall have a command-button to release the form resp. leave the program

When I pick this form from the class-library I am asked to create a FORMSET because
as far I understand a form picked from a class-lib can only reside on a VFP-standard form.

1. question: Is that correct understood?

If yes:

The command-button used to exit the form should have the command:

"thisformset.release".

So the button to exit the program only works fine, when there is a formset behind.
So I can not use this exit-button for a stand-alone (single) form as VFP claims that there
is no formset existing.

Do I have to create a second button in my library now, which includes the command:
"THIS FORMSET RELEASE" ? - or - can both functions combined in one code and in
relation whether I have a formset or only a single form I would work properly?



I only want to have confirmed how far I understood everything right - the german literature
concerning foxpro is very poor - and with the english language I have sometimes some problems...
but am just beginning to feel the big wealth and profitability of object-orientation.

Regards from Germany

Klaus





 
I'm not certain, but you may be trying to add a form in the Form Designer and as you say this requires a form set. but you don't have to have a form set in order to have more than one form, you just need to do a DO FORM formb... from within your form or a program.

In the development environment you can either type MODIFY FORM someform in the command window if you want to make changes to an existing form, or if you're trying to create your new class based on some other class use the

Code:
 MODIFY CLASS newclass OF newclasslib AS oldclass FROM oldclasslib

command. It tends to be a bit confusing since you assign the new class to a class library in the 'OF' clause but the class you're using as base class is in the 'as' clause.

They do this sort of backwards because they want to make as much optional as possible. Thus if you've already got the newclass that's all you need.

Getting to your actual question, I'd put some sort of IF... ENDIF in your release, or trap an error if there isn't a formset to realease rather than create a second button.
Dave Dardinger
 
Thank you Dave - and a star for this answer which helped me to clear the fog in my mind
concerning this matter.
I think conditional-programming/trapping is the best solution here.

Regards from Germany
Klaus


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top