Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
A simple way to call a function in a multi-routine prg?
Message
De
26/08/2007 22:27:51
Erick Miranda
Formata Data Business - Grupo Linx
Contagem, Brésil
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01250514
Message ID:
01250559
Vues:
11
Mark,
You could to use one parameter for Reference to return the needful value.
Note: By default, parameters are passed to programs and procedures by reference. (from VFP Help)
Note 2: Using SET UDFPARMS TO VALUE does not affect the WITH clause in the DO command, which, by default, passes arguments to parameters by reference.
Good luck!



>Something that I've always wanted to be able to do. Is there a way to do this?
>
>Given a PRG file with multiple procedures / functions in it. From within the code in the PRG file, the functions in that PRG file are callable as functions, and those functions can return a value. However, from outside of the PRG file (unless you do a SET PROC) those functions are only callable as procedures, and you can't get a return value. That is, given function MyFunc within MyPRG.PRG, the only thing you can do from outside MyPRG is:
>Do MyFunc in MyPRG with Parameters....
>
>I wish there was a built-in way to do something like:
>MyResult = MyFunc(Parameters...) IN MyPRG
>
>Am I overlooking a way to obtain this functionality IN THE ABSENCE of creating a classlib or doing a SET PROC. All I want to do is invoke a function within a PRG file and get a value back. Thanks.
Erick
Força Sempre!
Strength Always!
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform