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 luReturnI 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 lnProgramID2to this, calling the new oApp.DoModalForm method:
lnProgramID2 = oApp.DoModalForm('GetProgram',"Select second program:")