Information générale
Catégorie:
Codage, syntaxe et commandes
>>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
>Vlad,
>
>It appears that some programmer did NOT know that parameters are already PRIVATE by default and was trying to insure that the parameter was private.
Yes, this is the case. Barbara solved the big mistery: the programmer came from Clipper and in Clipper params are LOCAL and not PRIVATE. Obviously, he didn't know this is different in FoxPro.
Vlad
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement