Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Strange syntax
Message
De
26/12/2014 14:26:24
 
 
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
Versions des environnements
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01612723
Message ID:
01612729
Vues:
60
This message has been marked as a message which has helped to the initial question of the thread.
>>>In one of the methods I see the following code
>>>
>>>
>>>searchValue = searchValue = pi.GetValue(searchCriteriaViewModel);
>>>
>>>What does this double = mean here? Is it a typo or has some meaning?
>>>
>>>Thanks in advance.
>>
>>This seems like a boolean variable. Basically, the searchValue boolean variable would be True if the new value equals the previous value. I have seen something like that before and adjusted the code after as this is highly confusing. Not totally sure if this is the case here but maybe someone else can provide more info.
>
>I don't think it's a boolean variable. It seems to be an object variable with properties.

Its probably a typo and could be interpreted in one of three ways.

If search value is boolean and pi.GetValue returns a boolean, it could be:
searchValue = searchValue == pi.GetValue(searchCriteriaViewModel);
Another case is that the original developer was either trying to set two variables to the same value:
searchValue = otherSearchValue = pi.GetValue(searchCriteriaViewModel);
Or it could be that the original developer just put searchValue in twice by accident or copying and pasting one to many times. If that method is working properly at the moment, I would assume the last scenario and remove one of the searchValue assignments.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform