content of ask file
Jim Ault
JimAultWins at yahoo.com
Sat Nov 11 19:45:19 EST 2006
you could ..............
put empty into userAnswer
repeat until (not userAnswer contains "/")
ask file > using userAnswer as the default
put it into userAnswer
repeat until last char of userAnswer is not "/"
delete last char of userAnswer
end repeat
if userAnswer contains "/" then
answer "the slash cannot be part of the filename... please modify your
entry" & cr & userAnswer
end repeat
You get the idea.. test the answer. You could also test by
put "testString" into url ("file:"& userAnswer)
if there is not a file userAnswer then
[must be illegal for some reason]
else
delete file userAnswer
end if
Jim Ault
Las Vegas
On 11/11/06 3:54 PM, "Scott Morrow" <scott at elementarysoftware.com> wrote:
> After presenting the < ask file > dialog what would be the best way
> to determine what the user typed?
>
> If they enter a slash "/" as part of the file name then getting item
> -1 of it won't work.
>
> Perhaps my question should be:
>
> How might I keep the user from entering a slash as part of the file
> name?
> Or, how do other folks deal with this?
>
> -Scott Morrow
More information about the use-livecode
mailing list