content of ask file
JimAultWins at yahoo.com
Sat Nov 11 18:45:19 CST 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
if userAnswer contains "/" then
answer "the slash cannot be part of the filename... please modify your
entry" & cr & userAnswer
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]
delete file userAnswer
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
> Or, how do other folks deal with this?
> -Scott Morrow
More information about the use-livecode