Then you'd have to deal with backspace, and the fact that the response may be 999x or 9999x.

What it actually needs is a good generic regular expression udf, so you can do:
code:
While Not $sRoomNumber
"Enter room number: " GetS $sRoomNumber
If Not Matches($sRoomNumber,"999[a-e]|9999[a-e]")
"Room number is invalid." ?
$sRoomNumber=""
EndIf
Loop

Oops. Hijacked thread [Embarrassed]