Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Hexadecimal const declare

Hexadecimal const declare

Scheduled Pinned Locked Moved Visual Basic
csharphelpquestion
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    garfield185
    wrote on last edited by
    #1

    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

    C J 2 Replies Last reply
    0
    • G garfield185

      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

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      • G garfield185

        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

        J Offline
        J Offline
        JoeSharp
        wrote on last edited by
        #3

        hi visual basic does not support ox00008603L try with: Public Const ABCDE_FGH As Integer = &H00008603L or Public Const ABCDE_FGH As Long = &H00008603L

        G 1 Reply Last reply
        0
        • J JoeSharp

          hi visual basic does not support ox00008603L try with: Public Const ABCDE_FGH As Integer = &H00008603L or Public Const ABCDE_FGH As Long = &H00008603L

          G Offline
          G Offline
          garfield185
          wrote on last edited by
          #4

          Perfect. Thanks both of you!

          Time to come clean... Vive y deja vivir / Live and let live Javier

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups