作者A1pha ([αλφα])
看板Visual_Basic
标题[VB6 ] 请问要怎麽判断对方输入的资料的型态?
时间Tue Jan 9 18:08:47 2007
请问,
要怎麽判断对方输入在TXT里面的东西是数字还是文字啊?
我写了一个程式,要求对方在文字框中输入一些数字,
假使数字不对我还知道怎麽判断,
但是假使对方输入文字的话,
我该怎麽判断啊?
本来想说,用val(text1.text)来判断,假使是0的话,表示对方有可能输入文字,
但是,这样也有错,
假使我要设计的问题中,也要输入0的话,就无法分辨对方输入的是文字 还是 0。
看书学的,所以问题很烂QQ
感谢解答
--
"Every kid who has dreamed of being a baseball player has stood in his front
yard with a bat and said to himself, "Bottom of the ninth, Game 7 of the
World Series, the bases are loaded," and then envisioned hitting a home run
to win the game. My job is to shatter that dream."
By Huston Street
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 124.8.97.84
1F:推 ckndim:用"IF 判断式 Then"来做吧 01/09 18:23
2F:推 A1pha:问一下,判断式里面要写啥? 就是不知道怎麽判断QQ 01/09 18:29
3F:推 BearWu:检查ASCII码吧 01/09 18:30
4F:推 A1pha:我看z--12--4--1--21 里面有个Asc(Mid(s, i, 1)) 01/09 18:33
5F:→ A1pha:是用这个吧?@@" 01/09 18:35
6F:推 A1pha:喔喔! 刚刚查了一下 现在会用了~ 感谢XD 01/09 18:52
7F:推 fumizuki:IsNumeric(.......) 01/09 19:53
8F:推 A1pha:喔喔!! 感谢楼上XD 我来试试看~ 01/09 20:44
9F:推 A1pha:这个真方便QQ 谢谢板大XD 也感谢三楼,顺便学了两个函式 01/09 20:46