Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Application Framework DoForm
Message
 
 
To
22/09/2005 10:22:41
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 7
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01051754
Message ID:
01052441
Views:
12
Hi Greg,

In CodeBook The DoForm procedure is contained in Util.prg and I'm fairly certain that the statrup.prg has a SET PROCEDURE TO UTIL ADDITIVE.

What framework are you using? Also, have you added a SET PROCEDURE without the ADDITIVE clause somewhere? That would clear all other SET PROCEDURES.

>Thanks Mike but this didn't work for me. Here's the results of the things I tried:
>DoForm('Formname',variable) and =DoForm('Formname',variable) returns the error: doform.prg does not exist
>
>The standard command: Do Form 'Formname' with variable,variable,etc. works (except)
>The _application framework object doesn't see the form so the form starts up but is not contained inside the _application.aforms array and I sweep through this array throughout my application to see if particular forms are active and being edited, etc.
>
>GOAPP.DOFORM('Formname') without the "With & variables" gets the _application framework to open the form and place the form object in the array. Now I can manipulate anything within this form simply by referring to the _application.aforms() collection object.
>
>I just want to pass a parameter within the _application.doform() method.
>
>Here's a snippet of the article I found that started all this. The example is really very similar to what I'm trying to do. ( it is from a FoxTalk article I found at MSDN titled:"Create Modern Interfaces with VFP7" ). As you can see below, they just added the cust_id to the call.
>
>***********
>lcCommand = [iif(type('_screen.ActiveForm.Name') = ] + ;
> ['C' and _screen.ActiveForm.Name = ] + ;
> ['frmCustomers', _screen.ActiveForm.Seek('] + ;
> CUSTOMER.CUST_ID + ['), oApp.DoForm('Customers ] + ;
> [with "] + CUSTOMER.CUST_ID + ["'))]
>lcCaption = trim(CUSTOMER.COMPANY)
>oBookmark.AddBookmark(lcCommand, lcCaption)
>
>This code expects that the Bookmark class, which we'll look at in a moment, has been instantiated into a global variable called oBookmark. The AddBookmark method of that class expects two parameters: the command to execute when the bookmark is selected and the caption for the bookmark. In this case, the command tells VFP that if the active form is the customers form, call the Seek method of that form with the customer's CUST_ID value (that method positions the form to the specified key value); if there's no active form or it isn't the customers form, call the DoForm method of the application object, telling it to run the customers form and passing the CUST_ID value (the Init method of the customers form accepts an optional CUST_ID value and calls the Seek method if it's passed). The company name is used as the caption for the bookmark.
Regards,

Mike

"We try to solve the problem by rushing through the design process so that enough time is left at the end to uncover the errors that were made because we rushed through the design process."
- Glenford Myers

If you're going through hell, keep going. - Walt Disney
Previous
Reply
Map
View

Click here to load this message in the networking platform