CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2014
    Posts
    17

    [RESOLVED] How to detect if a variable is a Double, Int, Float Or A String <Beginner>

    Hey, what is going on guys. I Just thought of something and to see if it is possible. I was gonna see what kind of method or function I would have to use to detect and see if a user input entered a string, double, or a float. Say the user was to enter a word and it cannot be a float, double, nor an int. Only a letter or word. Then it prompts to you saying that you cannot enter a number or number with decimals in this dialog. Also vice-versa. I know that a while or for loop would probably make it easier. I just dont know were to find documentations on different functions and classes. Mostly how to use them with custom made variables like I'm trying to detect with. Anything will help.
    Last edited by Dylan3dx; June 30th, 2014 at 04:24 PM.

  2. #2
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: How to detect if a variable is a Double, Int, Float Or A String <Beginner>

    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  3. #3
    Join Date
    Jun 2014
    Posts
    17

    Re: How to detect if a variable is a Double, Int, Float Or A String <Beginner>

    Quote Originally Posted by dglienna View Post
    Okay this helps. This is what i wanted to see. I completely forgot about try and catch wow. Thanks

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