Results 1 to 3 of 3

Thread: Declarations in VB.Net

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2004
    Location
    UK
    Posts
    2

    Question Declarations in VB.Net

    This is really bugging me. I read some code that said

    Dim x as [Byte]

    What do the "[" square brackets mean. Is this an array?

    Sorry for appearing a bit thick

  2. #2
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    If the obj you're declaring is named after a reserved keyword , then you have to enclose it between brackets . This example should clear the confusion :

    VB Code:
    1. 'Class level structure
    2.  Public Structure [Byte]
    3.         Dim a As Integer
    4.         Dim b As Integer
    5.     End Structure
    6.  
    7. 'Inside a method :
    8. Dim x As [Byte]

  3. #3

    Thread Starter
    New Member
    Join Date
    Mar 2004
    Location
    UK
    Posts
    2

    Smile

    Thank you. I am a little embarressed that I did not realise this

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width