Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to use 'DO command IN exe' WITH ?
Message
De
18/08/2010 09:16:38
Mike Sue-Ping
Cambridge, Ontario, Canada
 
 
À
17/08/2010 20:37:57
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01476909
Message ID:
01477026
Vues:
63
>>I have a VFP9 exe (let's call it myVFP.exe) sitting in the same folder as my project file (let's call it myProject). myVFP.exe has a bunch of procedure files built into it and I'd like to call one of those procedures (let's call it myProcedure) from a form in myProject. The help file says that I should be able to do this using the syntax, "DO ProgramName1 | ProcedureName [IN ProgramName2] [WITH ParameterList]". So, naturally I tried the following command in my form's load event:
>>
>>DO myProcedure IN myVFP.exe WITH "someparam"
>>
>>and I receive "Procedure 'myProcedure' not found". The help file says, "If...the specified procedure isn't in the program file, the message "Procedure is not found" appears". I'm thinking that the latter message is kinda that same as what I receive. So, this begs the question, why do I get this error? I know for a fact that myVFP.exe has that procedure built into it.
>>
>>Is this not possible or am I doing something wrong. Any assistance is greatly appreciated.
>
>Let's say for example we create two programs, PROG1.PRG and PROG2.PRG where PROG2.PRG is to call procedure within PROG1.PRG.
>
>PROG1.PRG contains:
>? "Prog1.PRG"
>RETURN
>
>PROCEDURE SubProc1
>    PARAMETERS V1,V2,V3
>    ? "SubProc1 in Prog1"
>    ?? "  V1="+TRANSFORM(m.V1)
>    ?? ",  V2="+TRANSFORM(m.V2)
>    ?? ",  V3="+TRANSFORM(m.V3)
>ENDPROC
>
>PROG2.PRG contains:
>DO SubProc1 IN Prog1 WITH "one","two","three"
>
>
>You'll find that PROG2 works as expected and calls procedure within PROG1.PRG.
>
>
>
>On the other hand, if you try to break up PROG1.PRG into separate files it doesn't work because SubProc1.PRG is not a procedure within PROG1.PRG
>
>contents of PROG1.PRG:
>
>? "Prog1.PRG"
>RETURN
>
>
>contents of SUBPROC1.PRG:
>
>PARAMETERS V1,V2,V3
>? "SubProc1 in Prog1"
>?? "  V1="+TRANSFORM(m.V1)
>?? ",  V2="+TRANSFORM(m.V2)
>?? ",  V3="+TRANSFORM(m.V3)
>
Thanks for the info., but, my *EXE* contains several "SET PROCEDURE TO ... ADDITIVE" commands and the sub-procedure that I'm trying to call from my form is definitely there in the *EXE*. I'm stressing *EXE* here since it is not a PRG as you are describing. Does that matter?

Mike
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform