Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > is there any is integer function ?

Reply
Thread Tools

is there any is integer function ?

 
 
kmoloney kmoloney is offline
Junior Member
Join Date: Jan 2012
Posts: 1
 
      01-27-2012
In vb.net you get a cast error if you pass a string in some functions. This should take care of it:


Private Function IsPositiveInteger(ByVal objValue AsObject) As Boolean
Dim intX AsInteger
If Not (IsNumeric(objValue)) Then
Return False
Else
intX = CInt(objValue)
If objValue > 0 Then
Return True
Else
Return False
End If
End If
 

Last edited by kmoloney; 01-27-2012 at 07:32 PM.. Reason: Missing spaces
Reply With Quote
 
 
 
 
AJBiagioli AJBiagioli is offline
Junior Member
Join Date: Jan 2012
Posts: 1
 
      01-30-2012
' inputString is the string we want to test.
Dim number As Integer
If TryParse(inputString, number) AndAlso number > 0
'''' Continue here ....
End If
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Does ModelSim or any simulator software have a function similar tothe standard function any logic analizer has? Weng Tianxiang VHDL 7 09-11-2009 04:47 PM
is there a way to AutoParse a string to another type - e.g. if aDate format then date, else if integer than Integer etc ????? Greg Hauptmann Ruby 6 08-06-2008 04:52 PM
is there a way to call a function depending on an integer at runtime? aaragon C++ 15 12-30-2007 01:28 PM
501 PIX "deny any any" "allow any any" Any Anybody? Networking Student Cisco 4 11-16-2006 10:40 PM
How override ALL function calls? (Is there a "function call function"?) seberino@spawar.navy.mil Python 2 08-01-2005 12:38 PM



Advertisments