Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
  #1  
Old November 8th, 2004, 08:31 PM
Nmixer Nmixer is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 6 Nmixer User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Creating a Boolean Test for Numbers?

Alright in class i had a hard time learning this because we kinda just skipt through it.

is it somthing like...

Dim Name As Boolean

If Name is Numeric Then
]Code[
Else
]skip[
End if


.... ok thats wrong i know it is.

i would like to test a Text box... Thanks for any help

Reply With Quote
  #2  
Old November 8th, 2004, 08:57 PM
Doug G Doug G is offline
Grumpier Old Moderator
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Sep 2003
Posts: 10,143 Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 19 h 13 m
Reputation Power: 180
Try If IsNumeric(variable) Then ...
__________________
======
Doug G
======
I didn't attend the funeral, but I sent a nice letter saying I approved of it. --Mark Twain

Reply With Quote
  #3  
Old November 9th, 2004, 02:37 PM
Nmixer Nmixer is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 6 Nmixer User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Quote:
Originally Posted by Doug G
Try If IsNumeric(variable) Then ...



lol yeah thats it, thanks man,
-------------

ok well not reallt, it keeps giving me an error about IsNumeric

but i guess i will ask my teacher, thanks anyways

Reply With Quote
  #4  
Old November 10th, 2004, 05:55 AM
shaz shaz is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 4 shaz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Quote:
Originally Posted by Nmixer
lol yeah thats it, thanks man,
-------------

ok well not reallt, it keeps giving me an error about IsNumeric

but i guess i will ask my teacher, thanks anyways

I dont know if this is too advanced for you , but you can always use the 'try catch exception' statement while trying to assign values from the text box to the declared variable of type any number (eg int ,double etc). If the value from the text box in not the right type, an exception would be thrown, and then you can catch that exception to validate you field text.

Hope I am not confusing you.
Shaz

Reply With Quote
  #5  
Old November 17th, 2004, 07:20 PM
Lauramc's Avatar
Lauramc Lauramc is offline
SQL Slarentice
ASP Free Intermediate (1500 - 1999 posts)
 
Join Date: Nov 2004
Location: In My Happy Place
Posts: 1,783 Lauramc User rank is General 2nd Grade (Above 100000 Reputation Level)Lauramc User rank is General 2nd Grade (Above 100000 Reputation Level)Lauramc User rank is General 2nd Grade (Above 100000 Reputation Level)Lauramc User rank is General 2nd Grade (Above 100000 Reputation Level)Lauramc User rank is General 2nd Grade (Above 100000 Reputation Level)Lauramc User rank is General 2nd Grade (Above 100000 Reputation Level)Lauramc User rank is General 2nd Grade (Above 100000 Reputation Level)Lauramc User rank is General 2nd Grade (Above 100000 Reputation Level)Lauramc User rank is General 2nd Grade (Above 100000 Reputation Level)Lauramc User rank is General 2nd Grade (Above 100000 Reputation Level)Lauramc User rank is General 2nd Grade (Above 100000 Reputation Level)Lauramc User rank is General 2nd Grade (Above 100000 Reputation Level)Lauramc User rank is General 2nd Grade (Above 100000 Reputation Level)Lauramc User rank is General 2nd Grade (Above 100000 Reputation Level)Lauramc User rank is General 2nd Grade (Above 100000 Reputation Level)Lauramc User rank is General 2nd Grade (Above 100000 Reputation Level) 
Time spent in forums: 2 Weeks 1 Day 15 h 47 m 58 sec
Reputation Power: 1095
IsNumeric...

Just in case you did not check this... when using IsNumeric, make sure to specify that you
are evaluating the Text or Value property.

For example:

If Isnumeric(textbox1.text) Then 'VB.net or .value I think in VB6
.....
End If

Hope this helps...

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > Creating a Boolean Test for Numbers?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway