Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Local variable
Message
De
11/01/2009 12:49:27
 
 
À
11/01/2009 12:42:44
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:
01372654
Vues:
20
>I don't seem to duplicate his problem so I cannot help him.

Yes, Tracy ... that was exactly my point as well ... I can't duplicate his problem, given the example he provided. Hopefully he'll give us an example that illustrates his predicament better.

~~Bonnie



>>Try this without passing retval to second method and declaring retval in the second method (it should be visible there).
>
>I must be missing something because following your instructions, 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;         //now true
>
>            if (retVal)                 //passes since retVal = true
>            {
>                retVal = 2 + 2 < 0;     //set retVal to false
>            }
>
>            return retVal;              //return false
>        }
>
>
>I don't seem to duplicate his problem so I cannot help him.
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform