How to force a true TXT extension?

Ton Kuypers tkuypers at pandora.be
Wed Nov 23 19:39:47 EST 2005


William,

Try this, it also traps when the user clicks on "Cancel"...

ON mouseUp
     ask file "Bewaar woordenlijst als:" with "*.TXT"
     IF it = empty THEN exit mouseup
     put it into vUserChoice
     IF char -4 to -1 of vUserChoice <> ".TXT" THEN put ".TXT" after  
vUserChoice
     put field "woorden_uit" into URL ("file:" & vUserChoice)
     answer "De woordenlijst is bewaard!"
END mouseUp


Succes!

Ton Kuypers
Digital Media Partners bvba
Tel. +32 (0)477 / 739 530
Fax +32 (0)14 / 71 03 04
http://www.dmp-int.com



On 23-nov-05, at 23:37, William de Smet wrote:

> Hi there,
>
> Been busy for a while with my little program and ran into the  
> following problem:
> The user can save a file with a .TXT extension and with Windows XP  
> the dialog box shows the suggested *.TXT as filename.
> When deleting or overwriting the suggested name (without extension)  
> the saved file is not recognized as a .TXT file.
>
> How can I force a true .TXT extension (even when deleting the  
> suggested name)?
>
> I use the following code:
> on mouseUp
> ask file "Bewaar woordenlijst als:" with "*.TXT"
>   put field "woorden_uit" into URL ("file:" & it)
>   answer "De woordenlijst is bewaard!"
> end mouseUp
>
> Thanks!
>
> William de Smet
> _______________________________________________
> 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