Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Scope of variable in .PRG?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00453277
Message ID:
00453289
Vues:
23
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform