English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

if ther is isalpha() isnumeric() in C/C++ how can u check a string of it in VB 6.0? thanks

2007-02-03 23:57:24 · 2 answers · asked by 3nl70b1 1 in Computers & Internet Programming & Design

2 answers

There is an IsNumeric in Microsoft.VisualBasic.Information, but I don't think it supports decimal values.

Why don't you just write your own method? My VB6 is a little rusty but you should be able to figure it out...

Function IsNumeric(ByVal input As String) as Boolean

Dim NumberString As String
NumberString = "0123456789."

For i = 0 to Len(input)

If InStr(NumberString, Left(input, i, 1)) = 0 Then
Return False
End If

Next i

Return True

End Function

2007-02-04 00:28:50 · answer #1 · answered by Rex M 6 · 0 0

There is an ASCII code for each character in in VB.In addition to this you can also use KeyCode to trap user inputs and find out whether data is numeric or alphabetic.
The KeyPress(),KeyUP() and KeyDown() events provide this facility.

2007-02-05 07:36:53 · answer #2 · answered by Maxood 3 · 0 1

fedest.com, questions and answers