Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Scope of variable in .PRG?
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00453277
Message ID:
00453289
Views:
22
>If I declare a PUBLIC variable in my .PRG, for example -
>PUBLIC gcMyVariable
>gcMyVariable = ""
>
>and then I call another application using RUN MyApp.exe later in that same .PRG,
>can I reference the public variable gcMyVariable in a form that's part of MyApp.exe or do I have to pass the variable value using a parameter or something else? What's the best way to handle passing or referencing a variable value among or between .EXEs that are mostly running forms?
>
>TIA

If the other app is a VFP app and you call it with the DO command, your variables will be visible to it. Otherwise, you would have to pass the variable to the EXE, and that EXE would have to be able to accept parameters -- RUN MyApp.EXE Parm1, Parm2. In VFP this works just like any other procedure call where you have the first line of code accepting the parms.
Mark McCasland
Midlothian, TX USA
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform