Why Bracketed [TYPES] ?


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Why Bracketed [TYPES] ?

  1. #1
    Danny Guest

    Why Bracketed [TYPES] ?


    Hi all,
    In some of microsofts code examples when they declare a new variable they
    put brackets around the type. For example:

    Dim sendBytes As [Byte]() = Encoding.ASCII.GetBytes(responseString)
    ^ ^

    Do you know why this is?
    Thanks,
    Danny

  2. #2
    David Williams Guest

    Re: Why Bracketed [TYPES] ?

    Not sure "why" in all cases, but the brackets allow you to use reserved
    words in your application. For instance:

    Public Property [Stop] As Boolean

    will not compile if you do not have the brackets. But I think you could see
    where it might be nice to have a property (or sub or function) named Stop.

    HTH

    David

    "Danny" <vb.@127.0.0.1> wrote in message news:3cf921fa$1@10.1.10.29...
    >
    > Hi all,
    > In some of microsofts code examples when they declare a new variable they
    > put brackets around the type. For example:
    >
    > Dim sendBytes As [Byte]() = Encoding.ASCII.GetBytes(responseString)
    > ^ ^
    >
    > Do you know why this is?
    > Thanks,
    > Danny




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center