Ask a Language Designer: boolean: C# vs. Xml

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Metro Sauper

    Ask a Language Designer: boolean: C# vs. Xml

    Why is the default text representation for booleans in C# 'True' and 'False'
    whereas in xml it is 'true' and 'false'?

    It seems like it would make sense to have them both the same.

    Metro T. Sauper, Jr.
    President
    Sauper Associates, Inc.


  • Greg Ewing [MVP]

    #2
    Re: Ask a Language Designer: boolean: C# vs. Xml

    Metro, I'm not sure what you mean by the default text representation of a
    boolean. In C# code booleans appear as true and false. WRT to making them
    the same as XML, there is no connection between XML and C# other than C# can
    read, write and process XML. One could ask the same thing as to why in
    VB.Net they are True and False vs true and false, or C++, or probably many
    different languages. I'm curious why you would think that C# syntax or
    defaults should be driven by one standard (xml) over any other.

    What are you doing that brought this up?

    --
    Greg Ewing [MVP]
    Accomplish Your Mission with Better IT | IT support for nonprofits. You deserve peace of mind. National and remote outsourced nonprofit IT.





    "Metro Sauper" <msauper@sauper .com> wrote in message
    news:O2npemkmDH A.2436@TK2MSFTN GP09.phx.gbl...[color=blue]
    > Why is the default text representation for booleans in C# 'True' and[/color]
    'False'[color=blue]
    > whereas in xml it is 'true' and 'false'?
    >
    > It seems like it would make sense to have them both the same.
    >
    > Metro T. Sauper, Jr.
    > President
    > Sauper Associates, Inc.
    >
    >[/color]


    Comment

    • Jon Skeet [C# MVP]

      #3
      Re: Ask a Language Designer: boolean: C# vs. Xml

      Greg Ewing [MVP] <gewing@_NO_SPA M_citidc.com> wrote:[color=blue]
      > Metro, I'm not sure what you mean by the default text representation of a
      > boolean.[/color]

      Try this:

      using System;

      public class Test
      {
      static void Main()
      {
      Console.WriteLi ne (true.ToString( ));
      Console.WriteLi ne (false.ToString ());
      }
      }

      That prints:

      True
      False

      I'm pretty sure that's what the OP was talking about.

      It's not C# that does this, of course, but .NET itself.

      --
      Jon Skeet - <skeet@pobox.co m>
      Pobox has been discontinued as a separate service, and all existing customers moved to the Fastmail platform.

      If replying to the group, please do not mail me too

      Comment

      • Greg Ewing [MVP]

        #4
        Re: Ask a Language Designer: boolean: C# vs. Xml

        Ah, I see. Metro, is that what you are talking about?

        --
        Greg Ewing [MVP]
        Accomplish Your Mission with Better IT | IT support for nonprofits. You deserve peace of mind. National and remote outsourced nonprofit IT.




        "Jon Skeet [C# MVP]" <skeet@pobox.co m> wrote in message
        news:MPG.1a0377 eeda86e3ad98993 4@msnews.micros oft.com...[color=blue]
        > Greg Ewing [MVP] <gewing@_NO_SPA M_citidc.com> wrote:[color=green]
        > > Metro, I'm not sure what you mean by the default text representation of[/color][/color]
        a[color=blue][color=green]
        > > boolean.[/color]
        >
        > Try this:
        >
        > using System;
        >
        > public class Test
        > {
        > static void Main()
        > {
        > Console.WriteLi ne (true.ToString( ));
        > Console.WriteLi ne (false.ToString ());
        > }
        > }
        >
        > That prints:
        >
        > True
        > False
        >
        > I'm pretty sure that's what the OP was talking about.
        >
        > It's not C# that does this, of course, but .NET itself.
        >
        > --
        > Jon Skeet - <skeet@pobox.co m>
        > http://www.pobox.com/~skeet
        > If replying to the group, please do not mail me too[/color]


        Comment

        • Michael A. Covington

          #5
          Re: Ask a Language Designer: boolean: C# vs. Xml

          In .NET, they are (I think) Boolean.True and Boolean.False. In C#, they are
          true and false. .NET isn't C#.


          Comment

          • Jeffrey Tan[MSFT]

            #6
            Re: Ask a Language Designer: boolean: C# vs. Xml


            Hi,

            I think the true, false in C# are the type value of C#, and it is the
            mapping of .Net Framework type value. While in .Net, this type value is
            True and False.
            This is similiar as the int vs Int32, string vs String type mapping
            relationship.

            Hope this help,

            Jeffrey Tan
            Microsoft Online Partner Support
            Get Secure! - www.microsoft.com/security
            This posting is provided "as is" with no warranties and confers no rights.

            --------------------
            | From: Jon Skeet [C# MVP] <skeet@pobox.co m>
            | Subject: Re: Ask a Language Designer: boolean: C# vs. Xml
            | Date: Fri, 24 Oct 2003 18:55:27 +0100
            | Message-ID: <MPG.1a0377eeda 86e3ad989934@ms news.microsoft. com>
            | References: <O2npemkmDHA.24 36@TK2MSFTNGP09 .phx.gbl>
            <uL0Fb7kmDHA.24 04@TK2MSFTNGP12 .phx.gbl>
            | MIME-Version: 1.0
            | Content-Type: text/plain; charset="iso-8859-1"
            | Content-Transfer-Encoding: 7bit
            | X-Newsreader: MicroPlanet Gravity v2.60
            | Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
            | NNTP-Posting-Host: cpc3-rdng5-6-0-cust143.winn.ca ble.ntl.com
            81.103.154.143
            | Lines: 1
            | Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!TK2 MSFTNGP12.phx.g bl
            | Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.langua ges.csharp:1938 68
            | X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp
            |
            | Greg Ewing [MVP] <gewing@_NO_SPA M_citidc.com> wrote:
            | > Metro, I'm not sure what you mean by the default text representation of
            a
            | > boolean.
            |
            | Try this:
            |
            | using System;
            |
            | public class Test
            | {
            | static void Main()
            | {
            | Console.WriteLi ne (true.ToString( ));
            | Console.WriteLi ne (false.ToString ());
            | }
            | }
            |
            | That prints:
            |
            | True
            | False
            |
            | I'm pretty sure that's what the OP was talking about.
            |
            | It's not C# that does this, of course, but .NET itself.
            |
            | --
            | Jon Skeet - <skeet@pobox.co m>
            | http://www.pobox.com/~skeet
            | If replying to the group, please do not mail me too
            |

            Comment

            • Metro Sauper

              #7
              Re: Ask a Language Designer: boolean: C# vs. Xml

              The specific issue that brought this to mind is as follows:

              We are using xml to store some default configuration for reports. An xml
              entry might appear as follows:

              <Parameter Name="ShowDetai l" Type="System.Bo olean" Value="true" />

              Now normally with xml, we use "XmlConvert.ToB oolean(string)" to convert
              values from xml to the specific datatype, in this case boolean.

              However, because the datatype is defined in the entry and not predefined, I
              wanted to use the Convert.ChangeT ype() method to evaluate the entry.
              Somthing like:

              object parameterValue = Convert.Chanage Type(node.Attri butes["Value"].Value,
              System.GetType( node.Attributes[Type].Value));

              However, this did not work because we configured the value as "true" rather
              than "True". So now our configuration xml has "true/false" everywhere there
              are boolean values EXCEPT for the parameter values where the value is
              "True/False" since we use the XmlConvert for all values other than the ones
              where we would like to use Convert.ChangeT ype().

              Now, I know how to solve the problem. There are lots of ways to solve it.
              That is not the question. I posed the question after reading the other "Ask
              a Language Designer" questions and responded to the offer to post a question
              here.

              The question is "Why are the default text representations for boolean
              different in .Net and XML?"

              Thank you for you consideration of this question.

              Metro T. Sauper, Jr.
              President
              Sauper Associates, Inc.

              ""Jeffrey Tan[MSFT]"" <v-jetan@online.mi crosoft.com> wrote in message
              news:NFHhPArmDH A.1772@cpmsftng xa06.phx.gbl...[color=blue]
              >
              > Hi,
              >
              > I think the true, false in C# are the type value of C#, and it is the
              > mapping of .Net Framework type value. While in .Net, this type value is
              > True and False.
              > This is similiar as the int vs Int32, string vs String type mapping
              > relationship.
              >
              > Hope this help,
              >
              > Jeffrey Tan
              > Microsoft Online Partner Support
              > Get Secure! - www.microsoft.com/security
              > This posting is provided "as is" with no warranties and confers no rights.
              >
              > --------------------
              > | From: Jon Skeet [C# MVP] <skeet@pobox.co m>
              > | Subject: Re: Ask a Language Designer: boolean: C# vs. Xml
              > | Date: Fri, 24 Oct 2003 18:55:27 +0100
              > | Message-ID: <MPG.1a0377eeda 86e3ad989934@ms news.microsoft. com>
              > | References: <O2npemkmDHA.24 36@TK2MSFTNGP09 .phx.gbl>
              > <uL0Fb7kmDHA.24 04@TK2MSFTNGP12 .phx.gbl>
              > | MIME-Version: 1.0
              > | Content-Type: text/plain; charset="iso-8859-1"
              > | Content-Transfer-Encoding: 7bit
              > | X-Newsreader: MicroPlanet Gravity v2.60
              > | Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
              > | NNTP-Posting-Host: cpc3-rdng5-6-0-cust143.winn.ca ble.ntl.com
              > 81.103.154.143
              > | Lines: 1
              > | Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!TK2 MSFTNGP12.phx.g bl
              > | Xref: cpmsftngxa06.ph x.gbl[/color]
              microsoft.publi c.dotnet.langua ges.csharp:1938 68[color=blue]
              > | X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp
              > |
              > | Greg Ewing [MVP] <gewing@_NO_SPA M_citidc.com> wrote:
              > | > Metro, I'm not sure what you mean by the default text representation[/color]
              of[color=blue]
              > a
              > | > boolean.
              > |
              > | Try this:
              > |
              > | using System;
              > |
              > | public class Test
              > | {
              > | static void Main()
              > | {
              > | Console.WriteLi ne (true.ToString( ));
              > | Console.WriteLi ne (false.ToString ());
              > | }
              > | }
              > |
              > | That prints:
              > |
              > | True
              > | False
              > |
              > | I'm pretty sure that's what the OP was talking about.
              > |
              > | It's not C# that does this, of course, but .NET itself.
              > |
              > | --
              > | Jon Skeet - <skeet@pobox.co m>
              > | http://www.pobox.com/~skeet
              > | If replying to the group, please do not mail me too
              > |
              >[/color]


              Comment

              • Jeffrey Tan[MSFT]

                #8
                Re: Ask a Language Designer: boolean: C# vs. Xml


                Hi Metro,

                Thanks for your feedback.
                I think our discussion already shows that in C# the bool type's value are
                true and false, while the bool type is mapping to the .Net Framework
                Boolean type and its value are True and False.

                Does this answer your question?

                Best regards,
                Jeffrey Tan
                Microsoft Online Partner Support
                Get Secure! - www.microsoft.com/security
                This posting is provided "as is" with no warranties and confers no rights.

                --------------------
                | From: "Metro Sauper" <msauper@sauper .com>
                | References: <O2npemkmDHA.24 36@TK2MSFTNGP09 .phx.gbl>
                <uL0Fb7kmDHA.24 04@TK2MSFTNGP12 .phx.gbl>
                <MPG.1a0377eeda 86e3ad989934@ms news.microsoft. com>
                <NFHhPArmDHA.17 72@cpmsftngxa06 .phx.gbl>
                | Subject: Re: Ask a Language Designer: boolean: C# vs. Xml
                | Date: Sat, 25 Oct 2003 01:19:47 -0400
                | Lines: 111
                | X-Priority: 3
                | X-MSMail-Priority: Normal
                | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
                | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
                | Message-ID: <#CXWDfrmDHA.28 20@TK2MSFTNGP10 .phx.gbl>
                | Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
                | NNTP-Posting-Host: pcp047007pcs.tr nrsv01.nj.comca st.net 68.46.19.104
                | Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!TK2 MSFTNGP10.phx.g bl
                | Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.langua ges.csharp:1939 72
                | X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp
                |
                | The specific issue that brought this to mind is as follows:
                |
                | We are using xml to store some default configuration for reports. An xml
                | entry might appear as follows:
                |
                | <Parameter Name="ShowDetai l" Type="System.Bo olean" Value="true" />
                |
                | Now normally with xml, we use "XmlConvert.ToB oolean(string)" to convert
                | values from xml to the specific datatype, in this case boolean.
                |
                | However, because the datatype is defined in the entry and not predefined,
                I
                | wanted to use the Convert.ChangeT ype() method to evaluate the entry.
                | Somthing like:
                |
                | object parameterValue =
                Convert.Chanage Type(node.Attri butes["Value"].Value,
                | System.GetType( node.Attributes[Type].Value));
                |
                | However, this did not work because we configured the value as "true"
                rather
                | than "True". So now our configuration xml has "true/false" everywhere
                there
                | are boolean values EXCEPT for the parameter values where the value is
                | "True/False" since we use the XmlConvert for all values other than the
                ones
                | where we would like to use Convert.ChangeT ype().
                |
                | Now, I know how to solve the problem. There are lots of ways to solve it.
                | That is not the question. I posed the question after reading the other
                "Ask
                | a Language Designer" questions and responded to the offer to post a
                question
                | here.
                |
                | The question is "Why are the default text representations for boolean
                | different in .Net and XML?"
                |
                | Thank you for you consideration of this question.
                |
                | Metro T. Sauper, Jr.
                | President
                | Sauper Associates, Inc.
                |
                | ""Jeffrey Tan[MSFT]"" <v-jetan@online.mi crosoft.com> wrote in message
                | news:NFHhPArmDH A.1772@cpmsftng xa06.phx.gbl...
                | >
                | > Hi,
                | >
                | > I think the true, false in C# are the type value of C#, and it is the
                | > mapping of .Net Framework type value. While in .Net, this type value is
                | > True and False.
                | > This is similiar as the int vs Int32, string vs String type mapping
                | > relationship.
                | >
                | > Hope this help,
                | >
                | > Jeffrey Tan
                | > Microsoft Online Partner Support
                | > Get Secure! - www.microsoft.com/security
                | > This posting is provided "as is" with no warranties and confers no
                rights.
                | >
                | > --------------------
                | > | From: Jon Skeet [C# MVP] <skeet@pobox.co m>
                | > | Subject: Re: Ask a Language Designer: boolean: C# vs. Xml
                | > | Date: Fri, 24 Oct 2003 18:55:27 +0100
                | > | Message-ID: <MPG.1a0377eeda 86e3ad989934@ms news.microsoft. com>
                | > | References: <O2npemkmDHA.24 36@TK2MSFTNGP09 .phx.gbl>
                | > <uL0Fb7kmDHA.24 04@TK2MSFTNGP12 .phx.gbl>
                | > | MIME-Version: 1.0
                | > | Content-Type: text/plain; charset="iso-8859-1"
                | > | Content-Transfer-Encoding: 7bit
                | > | X-Newsreader: MicroPlanet Gravity v2.60
                | > | Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
                | > | NNTP-Posting-Host: cpc3-rdng5-6-0-cust143.winn.ca ble.ntl.com
                | > 81.103.154.143
                | > | Lines: 1
                | > | Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!TK2 MSFTNGP12.phx.g bl
                | > | Xref: cpmsftngxa06.ph x.gbl
                | microsoft.publi c.dotnet.langua ges.csharp:1938 68
                | > | X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp
                | > |
                | > | Greg Ewing [MVP] <gewing@_NO_SPA M_citidc.com> wrote:
                | > | > Metro, I'm not sure what you mean by the default text representation
                | of
                | > a
                | > | > boolean.
                | > |
                | > | Try this:
                | > |
                | > | using System;
                | > |
                | > | public class Test
                | > | {
                | > | static void Main()
                | > | {
                | > | Console.WriteLi ne (true.ToString( ));
                | > | Console.WriteLi ne (false.ToString ());
                | > | }
                | > | }
                | > |
                | > | That prints:
                | > |
                | > | True
                | > | False
                | > |
                | > | I'm pretty sure that's what the OP was talking about.
                | > |
                | > | It's not C# that does this, of course, but .NET itself.
                | > |
                | > | --
                | > | Jon Skeet - <skeet@pobox.co m>
                | > | http://www.pobox.com/~skeet
                | > | If replying to the group, please do not mail me too
                | > |
                | >
                |
                |
                |

                Comment

                • Metro Sauper

                  #9
                  Re: Ask a Language Designer: boolean: C# vs. Xml

                  Hi Jeffery,

                  Well actually no. It doesn't answer my question.

                  I do understand what you are saying. We realized this the moment we
                  encountered the problem and changed our program accordingly.

                  Perhaps I expected too much when posting my original question. I was
                  looking for someone "in the know" to explain to me why the values were
                  different in the first place. What the "aha!" answer was that would make me
                  understand why the values need to be different in the first place -- that
                  there was more reason than the .Net implementors flipped a coin and
                  "capital" 'F' and 'T' won.

                  There is really no reason to continue this thread. I understand the
                  technical aspects of the issue.

                  Best regards,

                  Metro.

                  --------------------------------

                  Metro T. Sauper, Jr.
                  President
                  Sauper Associates, Inc.


                  ""Jeffrey Tan[MSFT]"" <v-jetan@online.mi crosoft.com> wrote in message
                  news:y2UCMKtmDH A.724@cpmsftngx a06.phx.gbl...[color=blue]
                  >
                  > Hi Metro,
                  >
                  > Thanks for your feedback.
                  > I think our discussion already shows that in C# the bool type's value are
                  > true and false, while the bool type is mapping to the .Net Framework
                  > Boolean type and its value are True and False.
                  >
                  > Does this answer your question?
                  >
                  > Best regards,
                  > Jeffrey Tan
                  > Microsoft Online Partner Support
                  > Get Secure! - www.microsoft.com/security
                  > This posting is provided "as is" with no warranties and confers no rights.
                  >
                  > --------------------
                  > | From: "Metro Sauper" <msauper@sauper .com>
                  > | References: <O2npemkmDHA.24 36@TK2MSFTNGP09 .phx.gbl>
                  > <uL0Fb7kmDHA.24 04@TK2MSFTNGP12 .phx.gbl>
                  > <MPG.1a0377eeda 86e3ad989934@ms news.microsoft. com>
                  > <NFHhPArmDHA.17 72@cpmsftngxa06 .phx.gbl>
                  > | Subject: Re: Ask a Language Designer: boolean: C# vs. Xml
                  > | Date: Sat, 25 Oct 2003 01:19:47 -0400
                  > | Lines: 111
                  > | X-Priority: 3
                  > | X-MSMail-Priority: Normal
                  > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
                  > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
                  > | Message-ID: <#CXWDfrmDHA.28 20@TK2MSFTNGP10 .phx.gbl>
                  > | Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
                  > | NNTP-Posting-Host: pcp047007pcs.tr nrsv01.nj.comca st.net 68.46.19.104
                  > | Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!TK2 MSFTNGP10.phx.g bl
                  > | Xref: cpmsftngxa06.ph x.gbl[/color]
                  microsoft.publi c.dotnet.langua ges.csharp:1939 72[color=blue]
                  > | X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp
                  > |
                  > | The specific issue that brought this to mind is as follows:
                  > |
                  > | We are using xml to store some default configuration for reports. An[/color]
                  xml[color=blue]
                  > | entry might appear as follows:
                  > |
                  > | <Parameter Name="ShowDetai l" Type="System.Bo olean" Value="true" />
                  > |
                  > | Now normally with xml, we use "XmlConvert.ToB oolean(string)" to convert
                  > | values from xml to the specific datatype, in this case boolean.
                  > |
                  > | However, because the datatype is defined in the entry and not[/color]
                  predefined,[color=blue]
                  > I
                  > | wanted to use the Convert.ChangeT ype() method to evaluate the entry.
                  > | Somthing like:
                  > |
                  > | object parameterValue =
                  > Convert.Chanage Type(node.Attri butes["Value"].Value,
                  > | System.GetType( node.Attributes[Type].Value));
                  > |
                  > | However, this did not work because we configured the value as "true"
                  > rather
                  > | than "True". So now our configuration xml has "true/false" everywhere
                  > there
                  > | are boolean values EXCEPT for the parameter values where the value is
                  > | "True/False" since we use the XmlConvert for all values other than the
                  > ones
                  > | where we would like to use Convert.ChangeT ype().
                  > |
                  > | Now, I know how to solve the problem. There are lots of ways to solve[/color]
                  it.[color=blue]
                  > | That is not the question. I posed the question after reading the other
                  > "Ask
                  > | a Language Designer" questions and responded to the offer to post a
                  > question
                  > | here.
                  > |
                  > | The question is "Why are the default text representations for boolean
                  > | different in .Net and XML?"
                  > |
                  > | Thank you for you consideration of this question.
                  > |
                  > | Metro T. Sauper, Jr.
                  > | President
                  > | Sauper Associates, Inc.
                  > |
                  > | ""Jeffrey Tan[MSFT]"" <v-jetan@online.mi crosoft.com> wrote in message
                  > | news:NFHhPArmDH A.1772@cpmsftng xa06.phx.gbl...
                  > | >
                  > | > Hi,
                  > | >
                  > | > I think the true, false in C# are the type value of C#, and it is the
                  > | > mapping of .Net Framework type value. While in .Net, this type value[/color]
                  is[color=blue]
                  > | > True and False.
                  > | > This is similiar as the int vs Int32, string vs String type mapping
                  > | > relationship.
                  > | >
                  > | > Hope this help,
                  > | >
                  > | > Jeffrey Tan
                  > | > Microsoft Online Partner Support
                  > | > Get Secure! - www.microsoft.com/security
                  > | > This posting is provided "as is" with no warranties and confers no
                  > rights.
                  > | >
                  > | > --------------------
                  > | > | From: Jon Skeet [C# MVP] <skeet@pobox.co m>
                  > | > | Subject: Re: Ask a Language Designer: boolean: C# vs. Xml
                  > | > | Date: Fri, 24 Oct 2003 18:55:27 +0100
                  > | > | Message-ID: <MPG.1a0377eeda 86e3ad989934@ms news.microsoft. com>
                  > | > | References: <O2npemkmDHA.24 36@TK2MSFTNGP09 .phx.gbl>
                  > | > <uL0Fb7kmDHA.24 04@TK2MSFTNGP12 .phx.gbl>
                  > | > | MIME-Version: 1.0
                  > | > | Content-Type: text/plain; charset="iso-8859-1"
                  > | > | Content-Transfer-Encoding: 7bit
                  > | > | X-Newsreader: MicroPlanet Gravity v2.60
                  > | > | Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
                  > | > | NNTP-Posting-Host: cpc3-rdng5-6-0-cust143.winn.ca ble.ntl.com
                  > | > 81.103.154.143
                  > | > | Lines: 1
                  > | > | Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!TK2 MSFTNGP12.phx.g bl
                  > | > | Xref: cpmsftngxa06.ph x.gbl
                  > | microsoft.publi c.dotnet.langua ges.csharp:1938 68
                  > | > | X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp
                  > | > |
                  > | > | Greg Ewing [MVP] <gewing@_NO_SPA M_citidc.com> wrote:
                  > | > | > Metro, I'm not sure what you mean by the default text[/color]
                  representation[color=blue]
                  > | of
                  > | > a
                  > | > | > boolean.
                  > | > |
                  > | > | Try this:
                  > | > |
                  > | > | using System;
                  > | > |
                  > | > | public class Test
                  > | > | {
                  > | > | static void Main()
                  > | > | {
                  > | > | Console.WriteLi ne (true.ToString( ));
                  > | > | Console.WriteLi ne (false.ToString ());
                  > | > | }
                  > | > | }
                  > | > |
                  > | > | That prints:
                  > | > |
                  > | > | True
                  > | > | False
                  > | > |
                  > | > | I'm pretty sure that's what the OP was talking about.
                  > | > |
                  > | > | It's not C# that does this, of course, but .NET itself.
                  > | > |
                  > | > | --
                  > | > | Jon Skeet - <skeet@pobox.co m>
                  > | > | http://www.pobox.com/~skeet
                  > | > | If replying to the group, please do not mail me too
                  > | > |
                  > | >
                  > |
                  > |
                  > |
                  >[/color]


                  Comment

                  Working...