<pre>function theLetter prompt,default,maxLength,filter  repeat    ask prompt with default    if maxLength is not empty then      if the length of it > maxLength then        answer "Trop long, maximum " & maxLength & "caractere(s)"        next repeat      end if    end if    if filter is not empty then      put true into valid      repeat with C = 1 to the length of it        if char C of it is not in filter then          answer "Le caractere " & char C of it & " n'est pas valide"          put false into valid          exit repeat        end if      end repeat      if valid is false then next repeat    end if    exit repeat  end repeat  return itend theLetter</pre>