Results 1 to 10 of 10

Thread: Unsigned Integers?

  1. #1

    Thread Starter
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913

    Unsigned Integers?

    dont have access to .NET right now so I cant check..but in VB .NET can we use Unsigned integers?

    ie
    Dim a As UInt32
    Dim b As UInt16
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  2. #2
    Frenzied Member Shawn N's Avatar
    Join Date
    Dec 2001
    Location
    Houston
    Posts
    1,631
    You have UInt16 - 64
    Please rate my post.

  3. #3

    Thread Starter
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    yippee!
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  4. #4
    Frenzied Member Shawn N's Avatar
    Join Date
    Dec 2001
    Location
    Houston
    Posts
    1,631
    I don't get what's so great about that. Isn't it just a normal variable type?
    Please rate my post.

  5. #5
    Hyperactive Member Scott Penner's Avatar
    Join Date
    Dec 2000
    Location
    Mountain View
    Posts
    327
    I don't think those work in VB.NET only in C#.
    You can correct me if I'm wrong.
    -scott
    he he he

  6. #6
    Hyperactive Member Bananafish's Avatar
    Join Date
    Jan 2001
    Posts
    394
    I think it does work in vb.NET

  7. #7
    Lively Member
    Join Date
    Aug 1999
    Location
    Amsterdam
    Posts
    117
    Scott is right, VB doesn't support unsigned integers !

  8. #8
    Frenzied Member
    Join Date
    Aug 2000
    Posts
    1,539
    just thought i would come in here and mock you vb'ers..
    no Unsigned inties for you
    just for us the real coders, c#

    oh ya, and i will confirm that unsigned ints are not in vb.net

  9. #9
    Hyperactive Member Bananafish's Avatar
    Join Date
    Jan 2001
    Posts
    394
    It is possible to declare variables as uint16 (32, 64) in vb.net although msdn does say it is not CLS-complient.


    Represents a 16-bit unsigned integer.

    The UInt16 type is not CLS-compliant. The CLS-compliant alternative type is Int32. Int16 can be used when the original value is less than half of UInt16.MaxValue. For more information about CLS compliance, see What is the Common Language Specification.

    Remarks
    The UInt16 value type represents unsigned integers with values ranging from 0 to 65535.
    So now I am confused. If I can declare them, and use them - are they supported or not?

  10. #10
    Lively Member
    Join Date
    Aug 1999
    Location
    Amsterdam
    Posts
    117
    Not CLS-complient means that it is not specified in the Language Specification. Which means that when I have a C# Library that exposes a member using an unsigned integer it's possible that other languages, like VB, can't interoperate with my code.

    To insure you write CLS complient code take a look at the following attribute: [assembly:CLSCompliant(true)].

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