Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Application Framework DoForm
Message
From
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:
01051967
Views:
8
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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform