# Function to check if user input is between letters

**URL:** <https://discourse.julialang.org/t/function-to-check-if-user-input-is-between-letters/67668>\
**Category:** New to Julia\
**Created:** [September 3, 2021, 9:08pm UTC](https://discourse.julialang.org/t/function-to-check-if-user-input-is-between-letters/67668 "2021-09-03T21:08:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![hdcpereira](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hdcpereira/32/28705_2.png) [@hdcpereira](https://discourse.julialang.org/u/hdcpereira)\
**Post date:** [September 3, 2021, 9:08pm UTC](https://discourse.julialang.org/t/function-to-check-if-user-input-is-between-letters/67668/1 "2021-09-03T21:08:12Z")

</div>

I’m trying to write a function that checks if the user wrote the proper input, if it is, return the input, if its not, asks the user to try again. It looks like this:

```julia
function letter_between_AH()

    while false

        t = readline()
        t = uppercase(t)
        t_or_f = all(c-> 0x41 <= Int8(c) <= 0x48,t)

        if t_or_f
            return t
        else
            println("type a valid letter [A:H]")
            return false
        end
    end
end

```

It doesn’t seem to be working, when I call it, it gives me:

```julia
h = letter_between_AH()
print(h)
>> nothing

```

---

<div class="post-metadata">

**Author:** ![cjdoris](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cjdoris/32/213133_2.png) [@cjdoris](https://discourse.julialang.org/u/cjdoris)\
**Post date:** [September 3, 2021, 9:21pm UTC](https://discourse.julialang.org/t/function-to-check-if-user-input-is-between-letters/67668/2 "2021-09-03T21:21:53Z")

</div>

`while false`
