Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What's the secret meaning of this piece of code?
Message
De
02/08/1997 14:03:51
 
 
À
02/08/1997 14:00:11
Vinod Parwani
United Creations L.L.C.
Ad-Dulayl, Jordanie
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00042899
Message ID:
00042927
Vues:
42
In my opinion, the code is doing nothing, ie: the program status is exactly the same before and after the code. I don't see why something after this piece of code would change anything... (Except for the temp var which is not released).

Vlad

>See, maybe in the code afterwards...
>
>It may be writing something like..
>
>If exist thisvar...
>
>then do thisthing..
>
>or
>
>If type of thisvar is "C"
>
>then do..
>
>or
>
>If thisvar=....
>
>So, thats why I told you... If it is not doing any such thing..
>
>you can remove it.. but if it is doing any such thing.. then better to leave it as it is..
>
>
>>Thanks Vinod! But I know what each command is doing. :) I only want to know if there's any side effect of this code, if there's a hidden trick, etc. Because if there's nothing like that, the code is useless and it changes nothing in the program.
>>
>>Vlad
>>
>>>>>>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
>>>>>
>>>>>Afterwards in the program, Is it checking the value of cmd_param ??
>>>>
>>>>Yes, of course. Why?
>>>>
>>>>Vlad
>>>
>>>Yes, so that clears it.. Pls read the code carefully...
>>>
>>>>>>parameter Cmd_Param
>>>>>>
>>>>>>
if type("Cmd_Param") = "C"
>>>
>>>here it is checking any char. parameter passed it to it
>>>>>>   TempVar = Cmd_Param
>>>
>>>Preserving the value in a temporary variable..
>>>
>>>>>>   release Cmd_Param
>>>Relasing the Original Variable
>>>>>>   private Cmd_Param
>>>& again declaring it..
>>>>>>   Cmd_Param = TempVar
>>>>>>endif
>>>>
>>>& finally assigning the passed parameter which was saved in a temporarily variable..
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform