Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
External Script Access to .APP Forms
Message
De
21/02/2007 21:03:32
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
01197539
Message ID:
01197847
Vues:
22
Here it is. Pretty simple too. Thanks again to Naomi and to Dragan Nedeljkovich, who posted the original solution.

A reference to my app is stored in PUBLIC var oApp, which makes things simpler in this case. I added a DoModalForm method to the application object with the code below. I used the brute-force approach on parameters because I have a lot of existing forms that aren't set up to handle a parameter object.
LPARAMETERS tcForm,tuParm1,tuParm2,tuParm3,tuParm4,tuParm5,tuParm6
*
LOCAL ;
	lnParms,;
	luReturn
*
lnParms = PCOUNT()

IF TYPE('oMeta') <> 'O' OR ISNULL(oMeta) && reset Stonefield data manager if not found
	this.SetMetaData()
ENDIF

DO CASE
	CASE lnParms < 2
  		DO FORM (tcForm) TO luReturn
	CASE lnParms = 2
		DO FORM (tcForm) WITH tuParm1 TO luReturn
	CASE lnParms = 3
		DO FORM (tcForm) WITH tuParm1,tuParm2 TO luReturn
	CASE lnParms = 4
		DO FORM (tcForm) WITH tuParm1,tuParm2,tuParm3 TO luReturn
	CASE lnParms = 5
		DO FORM (tcForm) WITH tuParm1,tuParm2,tuParm3,tuParm4 TO luReturn
	CASE lnParms = 6
		DO FORM (tcForm) WITH tuParm1,tuParm2,tuParm3,tuParm4,tuParm5 TO luReturn
	CASE lnParms = 7
		DO FORM (tcForm) WITH tuParm1,tuParm2,tuParm3,tuParm4,tuParm5,tuParm6 TO luReturn
ENDCASE

RETURN luReturn
I didn't have to modify my ExecCode method, posted in the first message of this thread, at all. That method has the advantage over EXECSCRIPT of being able to use environmental settings like SET PROCEDURE and SET CLASSLIB. Then the call in VFP script code simply changes from something like this:
DO FORM GetProgram with "Select second program:" to lnProgramID2
to this, calling the new oApp.DoModalForm method:
lnProgramID2 = oApp.DoModalForm('GetProgram',"Select second program:")
Ray Roper
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform