Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Need to specify additional parameter
Message
 
 
À
24/01/2001 22:57:03
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Divers
Thread ID:
00468310
Message ID:
00468423
Vues:
23
Al,

Thanks for the reply. Yes, I added them at the end and I add check of validity of parameters. My guess that the application picks up somehow the older version of this program, so when I try something like OpenTable(Param1, Param2, Param3) it gives me this error, because original program didn't have Param3. The sad thing here, that I got this problem sporadically. Usually it works just fine, but sometimes I get this error. My guess is that I have to recompile bunch of projects and several of them are not mine...

>>Hi everybody,
>>
>>Quite recently I changed one of UDF, which is used in several our applications. I added couple new parameters, made it more robust, etc. However, sometimes I get a message: "Need to specify additional parameter" and when I try to debug, I see "Source not available" Error. Does it mean, I have to recompile all applications? Some of them are not mine...
>>
>>Thanks in advance.
>
>If you're adding new parameters, add them at the END of the LPARAMETERS list and do NOT change the order of the parameters that were there originally. For example:
* Original code:
>LPARAMETERS ;
>  tcParameter1, ;
>  tlParameter2, ;
>  tdParameter3
>
>* Change to:
>LPARAMETERS ;
>  tcParameter1, ;
>  tlParameter2, ;
>  tdParameter3, ;
>  tcNewParameter1, ;
>  ttNewParameter2, ;
>  ...
If a routine calls the UDF with fewer parameters than are in the LPARAMETERS statement, the extra ones (at the end) simply get initialized to .F. without error. If your modified routine depends on these values, you will need to set your own default values using something like this:
LPARAMETERS ;
>  tcParameter1, ;
>  tlParameter2, ;
>  tdParameter3, ;
>  tcNewParameter1, ;
>  ttNewParameter2
>
>LOCAL ;
>  lnParameterCount
>
>lnParameterCount = PCOUNT()
>
>IF lnParameterCount < 5
>  ttNewParamter2 = <i>SomeDefaultDateTimeValue</i>
>
>ENDIF
>
>IF lnParameterCount < 4
>  tcNewParamter1 = <i>SomeDefaultCharacterString</i>
>
>ENDIF
>
>* Using the reverse order as shown above, lets the calling function
>* specify 3, 4, or 5 parameters.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform