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

Thread: IsNumeric Bug

  1. #1
    Join Date
    Jun 2007
    Posts
    1

    IsNumeric Bug

    I have implemented my first VB.Net 2005 application and it works fine on my machine but on another machine the IsNumeric function is returning a false when it should be returning a true.

    Common.UserLevel = 0

    If Not IsNumeric(Common.UserLevel) Then
    IsUser = False
    End If

    Does anyone know of a reason why IsNumeric might work on one machine but not on another?

  2. #2
    Join Date
    Nov 2005
    Location
    Omaha, Nebraska, USA
    Posts
    696

    Re: IsNumeric Bug

    If IsNumeric is causing an issue, you could always try:
    Code:
    Common.UserLevel = 0
    
    If Not Integer.TryParse(Common.UserLevel, Nothing) Then
        IsUser = False
    End If
    Replace Integer with whatever numeric type that Common.UserLevel is supposed to contain (if it's a floating point, it'd be Double.TryParse(...)).

    As to why it's causing an issue, I could not say.

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