Results 1 to 8 of 8

Thread: what exactly does & mean?

  1. #1

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428

    what exactly does & mean?

    Const ENABLE_LINE_INPUT As Integer = &H2
    Const ENABLE_ECHO_INPUT As Integer = &H4
    Private Const STD_INPUT_HANDLE = -10&


    what does & mean when it's used for numbers?
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  2. #2
    Registered User
    Join Date
    Nov 2002
    Location
    Växjö, Sweden
    Posts
    314
    &H means that a hex number is following.

  3. #3

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    Originally posted by Athley
    &H means that a hex number is following.
    I still dont get it

    what does 10& mean? when I check the variable's value it's just 10.... btw I found that on a website.
    umm can you explain more plz
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  4. #4
    Registered User
    Join Date
    Nov 2002
    Location
    Växjö, Sweden
    Posts
    314
    &H is the only one I've seen, so I don't have an answerer to what 10& means, sorry.

  5. #5
    old fart Frans C's Avatar
    Join Date
    Oct 1999
    Location
    the Netherlands
    Posts
    2,926
    The &H prefix means a hex number is following, while a & suffix was used in vb6 to indicate the number was a long integer. What it is used for in VB.NET I don't know.


    PS. The ampersand can be used for string concatination as well.

  6. #6
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    To create a long constant use this:
    Public Const MyLong = 45L ' Forces data type to be a Long.
    That is from the MSDN library at this address:
    http://msdn.microsoft.com/library/de...eDescribed.asp

  7. #7
    old fart Frans C's Avatar
    Join Date
    Oct 1999
    Location
    the Netherlands
    Posts
    2,926
    It appears the ampersand suffix still forces the constant to be of the Long datatype. But because a Long is 64 bit in .NET, conversions from VB6 have to be done with care. If the constant should be forced to be 32 bit (like a long in VB6), you have to use the % sign instead (the type character for an integer)

    So the VB6 code:
    Private Const STD_INPUT_HANDLE = -10&

    should be converted to VB.NET like this:
    Private Const STD_INPUT_HANDLE = -10%

  8. #8

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    Originally posted by Frans C
    It appears the ampersand suffix still forces the constant to be of the Long datatype. But because a Long is 64 bit in .NET, conversions from VB6 have to be done with care. If the constant should be forced to be 32 bit (like a long in VB6), you have to use the % sign instead (the type character for an integer)

    So the VB6 code:
    Private Const STD_INPUT_HANDLE = -10&

    should be converted to VB.NET like this:
    Private Const STD_INPUT_HANDLE = -10%
    then why not just say
    Private const STR_INPUT_HDNALE as long = 10
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

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