Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Call proc in different directory
Message
De
24/06/2009 15:11:49
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
Divers
Thread ID:
01408150
Message ID:
01408204
Vues:
38
>>What syntax can i use (if this can be done at all) to call a utility procedure that is in a sub-directory that is not in the path? For example
>>SET PATH TO myDataDirectories
>>DO somecode
>>
>>** myFunc is in a directory not in the PATH
>>** I want to run this function and store the result in a variable
>>
>>myVar = myFunc(myParms) --> Error:  File myFunc.prg does not exist
>>myVar = subdir\myFunc(myParms) --> Error: Syntax Error
>>? subdir\myFunc(myParms) --> Error:  Command contains unrecognized phrase/keyword
>>
>>Can this be done?
>>
>>Thanks......Rich
>
>If you want it to return a value, I think there is no simple way except for some weird constructs with
>
>SET TEXT to lcScript
>   set path to ...
>   myVar = myProce()
>  _cliptext = myVar
>ENDTEXT
>
>execscript(lcScript)
>
>Otherwise
>
>you can do
>
>do myPath\MyProcedure with myParameters.

Thanks Naomi:

I'l really rather not do wierd constructions and it needs to return a result so calling as a procedure is out. I was hoping there was a simple way to call the function.

Looks like the simplest thing is just go back and fix my SET PATH to include this directory
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform