[2005]Values at end of Constant ex( &h1) ????
Im sorry to the elite coders here but i have a realy bad noob question.
What are the refrences or values at the end of certain lines of code. I have come across an instance i need to use a constant that holds a value like this and i want to understand what it is passing or representing.
Code:
Public Const RESOURCETYPE_DISK As Long = &H1
THe underlined is what i'm curious about, how does one read that??
Thanx....
Re: [2005]Values at end of Constant ex( &h1) ????
That represents the hex value 1, as opposed to the decimal value 1
&h1 = 1
&hA = 10
Re: [2005]Values at end of Constant ex( &h1) ????
ahhh!...
so the &H denotes that the next value is a HEX Value
so &H1A1 would be 000110100001(bin) or 417 right?
so in VB would &B be a binary ?? and im asuming the default is simply a decimal....
Re: [2005]Values at end of Constant ex( &h1) ????
so &H1A1 would be 000110100001(bin) or 417 right?
Correct
so in VB would &B be a binary ??
Nope, I don't believe there is syntax of this nature for binary
and im asuming the default is simply a decimal....
Correct
Re: [2005]Values at end of Constant ex( &h1) ????
There is no way to specify a binary literal. Standard is decimal and you can use &H and &O for hexadecimal and octal respectively. If you want to be able to specify a binary value you can only do this:
vb.net Code:
Dim int As Integer = Convert.ToInt32("10010110", 2)
The '2' specifies to convert from base 2.