Results 1 to 4 of 4

Thread: Converting Integer to an Unsigned Integer

  1. #1

    Thread Starter
    Addicted Member Frankie902's Avatar
    Join Date
    Feb 2001
    Location
    Lindenwold, NJ, USA
    Posts
    217

    Converting Integer to an Unsigned Integer

    I am trying to convert an Integer to UINT16. How do you do it?
    Using:
    Visual Studio .Net Enterprise
    Visual Basic 6.0 Enterprise

  2. #2
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    This , it won't compile . It says can't convert from integer to UInt16 .
    VB Code:
    1. Dim i As Integer
    2. i = CType(i, UInt16)

  3. #3
    Frenzied Member Mike Hildner's Avatar
    Join Date
    Jul 2002
    Location
    Des Moines, NM
    Posts
    1,690
    VB Code:
    1. Dim i As Integer
    2.         Dim u As UInt16
    3.  
    4.         i = 101
    5.         u = Convert.ToUInt16(i)

  4. #4
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Originally posted by Mike Hildner
    VB Code:
    1. Dim i As Integer
    2.         Dim u As UInt16
    3.  
    4.         i = 101
    5.         u = Convert.ToUInt16(i)
    D'uh , completely forgot about the static function Convert.....

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