| View previous topic :: View next topic |
| Author |
Message |
FreezingFire Admin Team

Joined: 23 Jun 2002 Posts: 3508
|
Posted: Fri Aug 09, 2002 12:17 pm Post subject: @FILEDLG() Extension Problem... |
|
|
When I use the @FILEDLG() box I am always faced with a problem: How can I check to see if the user typed an extension or add an extension if the user did not type one.
For example, if I always add an extension and the user types "file.ext" then my program will save the file as "file.ext.ext".
How can I have my program check to see if there is an extension and add one if one is not specified?  _________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
| Back to top |
|
 |
LiquidCode Moderator Team
Joined: 05 Dec 2000 Posts: 1753 Location: Space and Time
|
Posted: Fri Aug 09, 2002 12:20 pm Post subject: |
|
|
Here ya go:
| Code: |
%%file = @filedlg(*.txt)
if @not(@ext(%%file))
%%file = %%file".txt"
end
|
You can use the @ext() function to check the extension of a file.
Check the VDS help file for more info. _________________ Chris
Http://theblindhouse.com |
|
| Back to top |
|
 |
FreezingFire Admin Team

Joined: 23 Jun 2002 Posts: 3508
|
Posted: Fri Aug 09, 2002 12:51 pm Post subject: |
|
|
Thanks, I can't believe I missed that! _________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
| Back to top |
|
 |
|