|
-
Dec 4th, 2000, 03:48 PM
#1
Thread Starter
Lively Member
I have this textbox as a user input. How do I check if
there's a number in the textbox, and no letters?
To VB or not to VB, that's the question...
-
Dec 4th, 2000, 04:10 PM
#2
Hyperactive Member
Try the isnumeric function.
If isnumeric(text1.text) then
If things were easy, users might be programmers.
-
Dec 4th, 2000, 04:12 PM
#3
Thread Starter
Lively Member
I already figured that out... but thanx anyway :-)
To VB or not to VB, that's the question...
-
Dec 4th, 2000, 04:17 PM
#4
transcendental analytic
Code:
'in declarations:
option compare text
If isnumeric(text1) then 'it contains a numeric value
If text1 like "#" then 'it contains a number
if text1 like "*[!A-Z]*" then 'it contains no letters
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Dec 4th, 2000, 04:44 PM
#5
There's 2 other possibilities.
Code:
If Text1 like "*.*" Then 'it contains a decimal
If Text1 like "*-*" Then 'negative numbers
-
Dec 4th, 2000, 05:21 PM
#6
Frenzied Member
Hey Keda, now don't get sloppy my boy 
Code:
If text1 like "#" then 'will only fire if there is only one number :) (like if string = "2", NOT string = "h280q821")
If text1 like "*#*" then 'this, instead, will fire if there's a number in the string (like if string = "h280q821")
I wonder where you were, not online my friend (ICQ).
Jop - validweb.nl
Alcohol doesn't solve any problems, but then again, neither does milk.
-
Dec 4th, 2000, 06:35 PM
#7
Hyperactive Member
One annoying thing about IsNumeric:
Code:
?IsNumeric("$-6.0e-4")
True
-
Dec 4th, 2000, 09:03 PM
#8
transcendental analytic
Gives me false, remove the "$" and it should give true, thats because -6.0e-4 is expressed as a floating point. -6*10^(-4) which is -0.0004
yeah jop smart-ass! i was thinking about a number as one number. I'm online right now, but youre not
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|