"peej" wrote:
Is there a way to check if the text entered in the box is numeric?
type(screen.GetText()) returns String
val(type(screen.GetText())) returns Float (even if the text is not numeric)
Thanks!
Here's a somewhat clunky way to do it, but it works.
Function isInteger(MyText as String) as Boolean
if Len(MyText) = 0 return false
for i = 1 to Len(MyText)
digit = Mid(MyText, i, 1)
if Instr(1, "0123456789", digit) = 0 return false
next
return true
End Function
if isInteger(ZipCode)
' Do normal routine
else
' Do error routine
endif