CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Str -> Long

  1. #1
    Join Date
    Feb 2001
    Location
    New Jersey
    Posts
    312

    Str -> Long

    I am not sure how to do this
    I have a string and I need to convert it to a long.

    Code:
    dim x as long
    dim str as string
    
    str = "546"
    x = str

    I get an error doing this but I need to convert the str to a long somehow
    http://www.dewgames.com
    Shareware and Free games!

  2. #2
    Join Date
    Sep 2003
    Location
    Forever Gone... For Now...
    Posts
    1,515
    I get an error doing this but I need to convert the str to a long somehow
    That's because you are writing VB code in a C/C++ program.

    strtol sounds like it will do what you want...
    Thought for the day/week/month/year:
    Windows System Error 4006:
    Replication with a nonconfigured partner is not allowed.

  3. #3
    Join Date
    Feb 2001
    Location
    New Jersey
    Posts
    312
    ahh DOH

    Sorry I posted this in the wrong forum. Sorry...
    http://www.dewgames.com
    Shareware and Free games!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured