Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to use 'DO command IN exe' WITH ?
Message
From
18/08/2010 11:24:49
 
 
To
18/08/2010 09:16:38
Mike Sue-Ping
Cambridge, Ontario, Canada
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01476909
Message ID:
01477061
Views:
79
>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

If you compile the example programs PROG1.PRG and PROG2.PRG into respective EXEs you'll see that the behavior is as described. Put simply, you can't call procedures within EXE, APP or EXE through the DO ... IN ... if it's not declared within the main PRG of a EXE/APP. You can use SET PROCEDURE with an EXE/APP, but it only makes visible anything that is declared within the main PRG.

One thing that you might have to consider is using an "interface" procedures declared within the the main PRG to access programs contained with EXE/APP. So you'd have:

the following gets compiled into MAIN.EXE

MAIN.PRG
SET PROCEDURE TO Lib1.EXE
DO Proc1
The following gets compiled into LIB1.EXE

LIB1MAIN.PRG
RETURN

PROCEDURE Proc1
    DO SubProc1
ENDPROC
SUBPROC1.PRG
? "Subproc1"
As for why one might not simply put the text of SUBPROC1.PRG into LIB1MAIN.PRG
- you could run into limit to the size of a single PRG file.
- if code in SUBPROC1.PRG is very involved, maintenance-wise it'll be easier if you keep it in a separate PRG file.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform