or something like
select case PulseLength
case is > 165 and is < 176
OutValue=0
case is > 184 and is < 192
OutValue=1
end select

Dirk