UShort data type: Which library is required (if there is one)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Brent Blanchett
    New Member
    • Dec 2010
    • 1

    UShort data type: Which library is required (if there is one)

    Code:
    Public Sub Example()
    
        Dim num1 As Ushort
        
            num1 = 1
            
                Debug.Print num1
    
    End Sub
  • Stewart Ross
    Recognized Expert Moderator Specialist
    • Feb 2008
    • 2545

    #2
    Hi. I cannot find a library reference that would help in VBA. The UShort type is an unsigned integer available from the current generation of Visual Studio languages (see this link from MSDN for the VB version: http://msdn.microsoft.com/en-us/library/x68bebe2.aspx).

    Without knowing what context the UShort type is being used in your application I can't comment much on how to work around not having it in VBA (assuming that it is VBA you are using).

    Personally, I'd use a Long in its place, with Abs to make sure all values remain positive, but this is somewhat of a simplification of what can be a more complex picture. It all depends on why an unsigned type such as UShort is being used.

    -Stewart

    Comment

    Working...