Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Calling Procedure In VFP exe?
Message
De
02/05/2013 09:42:25
Mike Yearwood
Toronto, Ontario, Canada
 
 
À
02/05/2013 09:09:26
Mike Sue-Ping
Cambridge, Ontario, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Divers
Thread ID:
01572452
Message ID:
01572455
Vues:
83
Hi Mike

I've spent years trying to convince people to not use procedure files. They are usually an arbitrary collection of barely related things. I believe the set procedure command was originally a work around to allow longer procedure names than 8 char file names.

In your case, having a routine buried in a procedure file is preventing you from executing it the way you want. If you would extract that routine from the procedure file, add it to the project as a separate .prg file and rebuild your exe, you will still be able to execute it in the current exe and you will be able to execute it from an external exe via DO prgname IN exename.

HTH

>I'm trying to call a procedure in a separate executable. It only appears to work if the procedure is defined in the main program of the executable. For example:
>
>If testproc is defined in main.prg and I call it with DO testproc IN mytest.exe it works fine.
>
>If I define testproc in myprocs.prg and set procedure to myprocs.prg in the main program of the exe, when I try DO testproc IN mytest.exe I get a "Procedure 'testproc.prg' does not exist". Looks like the "set procedure to" command does not get called in this case.
>
>Does anyone have any suggestions for a workaround? I'm trying to create an optional "addon" to a product by creating a new exe that would try to reuse existing procedures in the "mytest.exe". mytest.exe has multiple set procedure to additive commands in it's startup. I figured that since they're already there, why bother including those procedures in the new exe. Apparently I can't unless I refactor mytest.exe.
>
>TIA
>Mike
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform