Hexadecimal const declare
-
Hi everybody I must declare some constants on VB.NET based on some C code that I have, like this. #define ABCDE_FGH 0x00008603L How could I do this on VB.NET? I get an error doing this: Public const ABCDE_FGH = 0x00008603L Public const ABCDE_FGH 0x00008603L And I'm afraid to use this: Public const ABCDE_FGH = "0x00008603L", because although I don't get an error, it would be only text... Does somebody know something about this? Thanks everybody
Time to come clean... Vive y deja vivir / Live and let live Javier
-
Hi everybody I must declare some constants on VB.NET based on some C code that I have, like this. #define ABCDE_FGH 0x00008603L How could I do this on VB.NET? I get an error doing this: Public const ABCDE_FGH = 0x00008603L Public const ABCDE_FGH 0x00008603L And I'm afraid to use this: Public const ABCDE_FGH = "0x00008603L", because although I don't get an error, it would be only text... Does somebody know something about this? Thanks everybody
Time to come clean... Vive y deja vivir / Live and let live Javier
garfield185 wrote:
Public const ABCDE_FGH = 0x00008603L
Did you read the error ? What does it say ? You don't have a type, just access modifiers. Try public const int, and if that doesn't work ( I dunno if VB supports 0x for hex ), try converting it to a decimal number in calculator and put that.
Christian Graus Driven to the arms of OSX by Vista. "! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums. I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
-
Hi everybody I must declare some constants on VB.NET based on some C code that I have, like this. #define ABCDE_FGH 0x00008603L How could I do this on VB.NET? I get an error doing this: Public const ABCDE_FGH = 0x00008603L Public const ABCDE_FGH 0x00008603L And I'm afraid to use this: Public const ABCDE_FGH = "0x00008603L", because although I don't get an error, it would be only text... Does somebody know something about this? Thanks everybody
Time to come clean... Vive y deja vivir / Live and let live Javier
-
hi visual basic does not support ox00008603L try with: Public Const ABCDE_FGH As Integer = &H00008603L or Public Const ABCDE_FGH As Long = &H00008603L
Perfect. Thanks both of you!
Time to come clean... Vive y deja vivir / Live and let live Javier