Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What's the secret meaning of this piece of code?
Message
De
03/08/1997 10:10:11
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00042899
Message ID:
00042980
Vues:
34
>>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.
Hi Jim,
I wonder if PARAMETERS is just enough to make a variable PRIVATE to only one PROC.

public myvar
myvar = 12

do lowerproc with myvar
do anotherproc


proc lowerproc
PARAMETERS myvar
myvar = 25

proc anotherproc
? myvar

Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform