字符串如何转数组判断其值!!欢迎讨论
想做一个文本框,纯数字输入,其它输入提示出错,长度为5
调试时(nbyte(j) > 48 And nbyte(j) < 57) j=1时,nbyte(j)ASC码为0
有没有字符串直接转数组检测的函数直接调用啊??
Private Sub Command1_Click()
Dim i As String
Dim j%
Dim nbyte() As Byte
i = Text1.Text
If Len(i) > 5 Then
i = "长度溢出"
Else:
nbyte() = i
For j = 0 To Len(i) - 1
If (nbyte(j) > 48 And nbyte(j) < 57) Then
Else:
i = "非法字符"
Exit For
End If
Next j
Text1.Text = i
End If
End Sub