Home All Groups Group Topic Archive Search About
Author
10 May 2007 1:59 PM
Submit2s
Hello, I'm trying to resolving a problem and new to data analysis.  What are
&H& numbers. ie I am looking at source code and not sure what the &H number
represent.

Public Enum enumFileDialog
   cdlOFNReadOnly = &H1
   cdlOFNOverwritePrompt = &H2
   cdlOFNHideReadOnly = &H4
   cdlOFNNoChangeDir = &H8
   cdlOFNSHOWHELP = &H10
   cdlOFNNoValidate = &H100
   cdlOFNAllowMultiselect = &H200
   cdlOFNExtensionDifferent = &H400
   cdlOFNPathMustExist = &H800
   cdlOFNFileMustExist = &H1000
   cdlOFNCreatePrompt = &H2000
   cdlOFNShareAware = &H4000
   cdlOFNNoReadOnlyReturn = &H8000
   cdlOFNNOTESTFILECREATE = &H10000
   cdlOFNNONETWORKBUTTON = &H20000
   cdlOFNNoLongNames = &H40000
   cdlOFNExplorer = &H80000
   cdlOFNNoDereferenceLinks = &H100000
   cdlOFNLongNames = &H200000

Author
10 May 2007 2:21 PM
Ralph
Show quote Hide quote
"Submit2s" <Submi***@discussions.microsoft.com> wrote in message
news:AC0C506D-DCB2-4C7B-B074-62BFC13DEDE7@microsoft.com...
> Hello, I'm trying to resolving a problem and new to data analysis.  What
are
> &H& numbers. ie I am looking at source code and not sure what the &H
number
> represent.
>
> Public Enum enumFileDialog
>    cdlOFNReadOnly = &H1
>    cdlOFNOverwritePrompt = &H2
>    cdlOFNHideReadOnly = &H4
>    cdlOFNNoChangeDir = &H8
>    cdlOFNSHOWHELP = &H10
>    cdlOFNNoValidate = &H100
>    cdlOFNAllowMultiselect = &H200
>    cdlOFNExtensionDifferent = &H400
>    cdlOFNPathMustExist = &H800
>    cdlOFNFileMustExist = &H1000
>    cdlOFNCreatePrompt = &H2000
>    cdlOFNShareAware = &H4000
>    cdlOFNNoReadOnlyReturn = &H8000
>    cdlOFNNOTESTFILECREATE = &H10000
>    cdlOFNNONETWORKBUTTON = &H20000
>    cdlOFNNoLongNames = &H40000
>    cdlOFNExplorer = &H80000
>    cdlOFNNoDereferenceLinks = &H100000
>    cdlOFNLongNames = &H200000

The '&' does double duty.
1) The '&H' prefix indicates the following characters are to be considered a
number in Hex format. As opposed to the default of decimal format.
Note: this has no effect on the actual internal representation of a number.
The 'bits' are the same.
2) A trailing '&' is a type-declaration character declaring the type as a
Long (4 bytes). Otherwise the value would be considered the default, which
is an Integer (two bytes).
This can occasionally be an issue when using numbers in bitwise comparisons.

hth
-ralph
Author
10 May 2007 2:24 PM
Ken Halter
Show quote Hide quote
"Submit2s" <Submi***@discussions.microsoft.com> wrote in message
news:AC0C506D-DCB2-4C7B-B074-62BFC13DEDE7@microsoft.com...
> Hello, I'm trying to resolving a problem and new to data analysis.  What
> are
> &H& numbers. ie I am looking at source code and not sure what the &H
> number
> represent.
>
> Public Enum enumFileDialog
>   cdlOFNReadOnly = &H1
>   cdlOFNOverwritePrompt = &H2
>   cdlOFNHideReadOnly = &H4
>   cdlOFNNoChangeDir = &H8
>   cdlOFNSHOWHELP = &H10

That means the number is written in hexadecimal, aka base-16. The standard
Windows calculator supports Hex/Binary and Decimal.

Conversion Table - Decimal - Hexadecimal - Binary
http://www.dewassoc.com/support/msdos/decimal_hexadecimal.htm

When the declaration ends with an '&', that means the author is making sure
the number is treated as a Long data type (vs Integer)


--
Ken Halter - MS-MVP-VB - Please keep all discussions in the groups..
In Loving Memory - http://www.vbsight.com/Remembrance.htm
Author
10 May 2007 2:24 PM
Rick Rothstein (MVP - VB)
> Hello, I'm trying to resolving a problem and new to data analysis.  What
> are
> &H& numbers. ie I am looking at source code and not sure what the &H
> number
> represent.

The &H in front of a number in VB means the characters that follow are
Hexadecimal digits (so, those characters will be the digits 0 to 9 plus the
letters A to F). The & after the number means the number is a Long data type
(that is, it is a 32-bit value).

Rick
Author
11 May 2007 6:20 AM
J French
On Thu, 10 May 2007 06:59:01 -0700, =?Utf-8?B?U3VibWl0MnM=?=
<Submi***@discussions.microsoft.com> wrote:

>Hello, I'm trying to resolving a problem and new to data analysis.  What are
>&H& numbers. ie I am looking at source code and not sure what the &H number
>represent.

Others have explained what it means
- try this to see the importance

Private Sub Command1_Click()
   Me.Print &HFFFF   ' 16 bit Integer
   Me.Print &HFFFF&  ' 32 bit Long
End Sub