This is pretty ugly, but it seems to work.

code:
do
$gotIt = 0
cls
gets $x
select
case len($x) = 4
if val(substr($x, 1, 3)) >= 100 and val(substr($x, 1, 3)) < 1000 and instr("abcde", substr($x, 4, 1))
$gotIt = 1
endif
case len($x) = 5
if val(substr($x, 1, 4)) >= 1000 and val(substr($x, 1, 4)) < 10000 and instr("abcdef", substr($x, 5, 1))
$gotIt = 1
endif

case(1)
;nothing
endselect
until $gotIt

_________________________
Eric