Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Need to specify additional parameter
Message
 
 
To
25/01/2001 12:07:15
Jonathan Cochran
Alion Science and Technology
Maryland, United States
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00468310
Message ID:
00468578
Views:
12
Thanks, Jonathan. I'll see, that can I do here.

>Just a guess, but the function is probably being cached in memory. The version that is called first in your program will be the version that is used by all subsequent calls. That is probably why you are sporadically seeing the error -- sometimes the old version is called first, and sometimes the new version is. You might want to try issuing a CLEAR PROGRAM in your code. We issue a CLEAR PROGRAM at the beginning and end of each of our executables, so we know that each executable is not dealing with cached programs, and it also clears any programs that it cached. Since there are programs that are not yours, you might want to issue this command both before and after each call to these programs.
>
>>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
Previous
Reply
Map
View

Click here to load this message in the networking platform