Yes, the entire promptForNum function will die if you did that.  I
obviously haven't tested the code after splitting the functions (my
super-complex giant if/then statement thing worked just fine, I didn't
manage to break it)
I will fix this


On Sat, Apr 5, 2014 at 1:46 AM, skwerlman <notifications@github.com> wrote:

> In apis/prompt.lua:
>
> > @@ -31,14 +31,38 @@ function promptForColor(text)
> >  end
> >  function promptForNum(text, min, max)
> >   term.write(text..": ")
> > - input = tonumber(read())
> > - if min == nil then
> > + local input = tonumber(read())
>
> Won't this crash if someone enters a string like 'hello'?
> Maybe try some regex magic like:
>
> local input = read()
> if input:match('[0-9]*') ~= input then
> --they didn't put in a number
> end
>
> --
> Reply to this email directly or view it on GitHub<https://github.com/SuicidalSTDz/EnderAPI/pull/39/files#r11320327>
> .
>