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. Converting string to integer

Converting string to integer

Scheduled Pinned Locked Moved Visual Basic
6 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.
  • J Offline
    J Offline
    johnjsm
    wrote on last edited by
    #1

    Hi Is there a way in vb6 to convert a string to an integer. The string I have will always be numbers. I need to do some maths on the string.

    D M 2 Replies Last reply
    0
    • J johnjsm

      Hi Is there a way in vb6 to convert a string to an integer. The string I have will always be numbers. I need to do some maths on the string.

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      Val[^] is what you're looking for.

      Dave Kreskowiak Microsoft MVP - Visual Basic

      J 1 Reply Last reply
      0
      • J johnjsm

        Hi Is there a way in vb6 to convert a string to an integer. The string I have will always be numbers. I need to do some maths on the string.

        M Offline
        M Offline
        Marc Soleda
        wrote on last edited by
        #3

        CInt or CLng will also work. Marc Soleda.

        ... she said you are the perfect stranger she said baby let's keep it like this... Dire Straits

        1 Reply Last reply
        0
        • D Dave Kreskowiak

          Val[^] is what you're looking for.

          Dave Kreskowiak Microsoft MVP - Visual Basic

          J Offline
          J Offline
          johnjsm
          wrote on last edited by
          #4

          Thanks. There is also one other thing when I try get the filelen of a file that is about 3gb in size it returns a -value that is no were near the correct size. This is waht I need to do the math on but can't because of the incorrect value given by filelen

          D 1 Reply Last reply
          0
          • J johnjsm

            Thanks. There is also one other thing when I try get the filelen of a file that is about 3gb in size it returns a -value that is no were near the correct size. This is waht I need to do the math on but can't because of the incorrect value given by filelen

            D Offline
            D Offline
            Dave Kreskowiak
            wrote on last edited by
            #5

            FileLen, since it's return value is a Long (32-bit signed Integer), will only work with files that are less that 2 GB in size. For anything larger, you'll have to call into the Win32 API to get the file size. Discussion[^].

            Dave Kreskowiak Microsoft MVP - Visual Basic

            J 1 Reply Last reply
            0
            • D Dave Kreskowiak

              FileLen, since it's return value is a Long (32-bit signed Integer), will only work with files that are less that 2 GB in size. For anything larger, you'll have to call into the Win32 API to get the file size. Discussion[^].

              Dave Kreskowiak Microsoft MVP - Visual Basic

              J Offline
              J Offline
              johnjsm
              wrote on last edited by
              #6

              Thanks a million. This worked perfectly.

              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