content of ask file

Scott Morrow scott at elementarysoftware.com
Sat Nov 11 21:59:49 EST 2006


Ken,
I have implemented your method of checking the folder path. Thank  
you. However, it seems a best available solution rather than a  
completely reliable one.

For instance, if there is a folder path:

/Users/myname/Desktop/billing/September/September

and I point my ask file at the first "September" folder

and I type in:     September/earnings.txt      as my file name

then a file      earnings.txt       will be created in the second  
"September" folder.  No data is lost and saving does take place but  
it feel like I should be able to keep this from happening to my users

It seems that there should be a way to discover what the user  
actually typed.  (as I suspected I didn't have any luck with front  
scripts catching rawKeyDown in this dialog)  Would this be something  
reasonable to BugZilla as a feature request?

I'm using Rev 2.6.1 on OSX 10.4.8



On Nov 11, 2006, at 5:09 PM, Ken Ray wrote:

> On 11/11/06 5: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?
>
> Here's a way you can use:
>
> on mouseUp
>   ask file "Enter a file path:"
>   put it into tPath
>   if tPath <> "" then
>     if there is a folder (item 1 to -2 of pPath) then
>       -- code if a good path
>       answer "OK"
>     else
>       -- code if a bad path
>       answer "Bad path"
>     end if
>   end if
> end mouseUp
>
> HTH,
>
> Ken Ray
> Sons of Thunder Software, Inc.
> Web site: http://www.sonsothunder.com/
> Email: kray at sonsothunder.com
>
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>




More information about the use-livecode mailing list