Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Local variable
Message
De
11/01/2009 11:55:41
 
 
À
10/01/2009 21:12:05
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Titre:
Versions des environnements
Environment:
C# 3.0
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01372518
Message ID:
01372648
Vues:
18
This works as well:
       static bool MyMethodA()
        {
            bool retVal = true;
            //retVal is true
            //check for retVal = true and MyMethodB returns true
            retVal = retVal && MyMethodB(out retVal);
            //retVal is now false
            return retVal;                   //returns false
        }

        static bool MyMethodB(out bool retVal)
        {
            //bool retVal = false;
            //Do Something
            retVal = 1 + 1 > 0;         //still true

            if (retVal)                      //passes since retVal = true
            {
                retVal = 2 + 2 < 0;     //set retVal to false
            }

            return retVal;                 //return false
        }
Am I not understanding your problem?
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform