>Recently, I had to optimize/debug/verify/etc an old project written in FP 2.6.
>
>At the begining of the main program I found the following code that doesn't make any sense to me. (I also asked other FoxPro programmers from our team, but no answer was found.):
>
>parameter Cmd_Param
>
>if type("Cmd_Param") = "C"
> TempVar = Cmd_Param
> release Cmd_Param
> private Cmd_Param
> Cmd_Param = TempVar
>endif
>
>I can't find any reason to have this piece of code in the program since, IMO, it does nothing. Am I missing something? Is there something subtle/secret/etc and I don't see it?
>
>Vlad
A few lines about this discussion. It's not true that the code does nothing. It releases a variable that may be declared local or public elsewhere. Also you say it's at the beginning of a main program. But every main program could be a procedure for another main program that you forgot that you used before. So it makes it a lower call. Think of this scenario :
* Anothermain.prg
Cmd_param = doacheck()
do main.prg with Cmd_param
if type("cmd_param") = "U" && Released ?
........
endif
* This type of code also strange could be used in copy protection.
Cetin