Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Local variable
Message
From
11/01/2009 15:47:27
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
10/01/2009 20:09:57
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:
01372678
Views:
15
>Hi,
>Thank you for reply.
>
>Actually I am not using string. I just use it as example. Below is my sample code":
>
>
>
>public class MyClass
>{
>    public bool MyMethodA()
>    {
>        bool retVal = false;
>        //Do Soemthing
>
>       retVal = retVal && this.MethodB();
>       return retVal;
>    }
>
>    public bool MyMethodB()
>    {
>        bool retVal = false;
>        //Do Something
>        retVal = 1 + 1 > 0;         //Example
>
>        if (retVal)                       // Weird
>        {
>            retVal = 2 + 2 > 0;     // Example
>        }
>
>        return retVal;
>    }
>}
>
>
>when I debug, the retVal at //Weird will compare wrongly. If I change retVal at MethodA to other name, then the problem will be gone. At idea?

I don't see anything weird in this code (but I corrected the MethodB as MyMethodB thinking it was a typo).
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform