Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Local variable
Message
 
 
To
11/01/2009 11:55:41
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Title:
Environment versions
Environment:
C# 3.0
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01372518
Message ID:
01372650
Views:
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?

Try this without passing retval to second method and declaring retval in the second method (it should be visible there).
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform