Function isvalidqqnumber (qqstring)
'Determine the QQ number format
Isvalidqqnumber = true
If Len (qqstring) <5 or Len (qqstring)> 12 then
Isvalidqqnumber = false
Else
For I = 1 to Len (qqstring)
Testchar = lcase (mid (qqstring, I, 1 ))
If not isnumeric (testchar) then
Isvalidqqnumber = false
Exit Function
End if
Next
Next
End if
End Function
Function isvalidtelnumber (strtelephone)
'Determine the phone number format
Isvalidtelnumber = true
If Len (strtelephone) <= 0 then
Isvalidtelnumber = false
Exit Function
End if
If left (strtelephone, 1) = "-" Or right (strtelephone, 1) = "-" then
Isvalidtelnumber = false
Exit Function
End if
For I = 1 to Len (strtelephone)
Testchar = mid (strtelephone, I, 1)
If testchar <> "-" then
If not isnumeric (testchar) then
Isvalidtelnumber = false
Exit Function
End if
End if
Next
End Function
Function isvalidmobilenumber (strmobile)
'Determine the mobile phone number format
Isvalidmobilenumber = true
If Len (strmobile) <= 0 then
Isvalidmobilenumber = false
Exit Function
Else
If Len (strmobile)> 13 then
Isvalidmobilenumber = false
Exit Function
End if
End if
For I = 1 to Len (strmobile)
Testchar = mid (strmobile, I, 1)
If not isnumeric (testchar) then
Isvalidmobilenumber = false
Exit Function
End if
Next
End Function
Function isvalidemail (email)
'Determine the email format
Isvalidemail = true
Emailstr = Split (email ,"@")
If ubound (emailstr) <> 1 then
Isvalidemail = false
Exit Function
End if
For each emailchr in emailstr
If Len (emailchr) <= 0 then
Isvalidemail = false
Exit Function
End if
For I = 1 to Len (emailchr)
Testchar = lcase (mid (emailchr, I, 1 ))
If instr ("abcdefghijklmnopqrstuvwxyz _-.", testchar) <= 0 and not isnumeric (testchar) then
'If it is not a letter allowed by a character, it must be a number
Isvalidemail = false
Exit Function
End if
Next
'The Allowed characters must contain the decimal point
If left (emailchr, 1) = "." Or right (emailchr, 1) = "." Then
Isvalidemail = false
Exit Function
End if
Next
If instr (emailstr (1), ".") <= 0 then
Isvalidemail = false
Exit Function
End if
I = Len (emailstr (1)-limit Rev (emailstr (1 ),".")
If I <> 2 and I <> 3 then
Isvalidemail = false
Exit Function
End if
If instr (email, "...")> 0 then
Isvalidemail = false
End if
End Function