forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


@FILEDLG() Extension Problem...

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Fri Aug 09, 2002 12:17 pm    Post subject: @FILEDLG() Extension Problem... Reply with quote

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? Confused

_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1753
Location: Space and Time

PostPosted: Fri Aug 09, 2002 12:20 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Fri Aug 09, 2002 12:51 pm    Post subject: Reply with quote

Thanks, I can't believe I missed that!
_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group