|
-
May 23rd, 2007, 01:45 PM
#1
Thread Starter
Lively Member
[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....
VB.Net uber-noob since04, Yeababy! 
-
May 23rd, 2007, 02:29 PM
#2
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
-
May 23rd, 2007, 03:51 PM
#3
Thread Starter
Lively Member
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....
VB.Net uber-noob since04, Yeababy! 
-
May 24th, 2007, 09:35 AM
#4
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
-
May 25th, 2007, 01:38 AM
#5
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|