Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Sun Nov 17, 2019 7:55 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Windows adds ".txt" to file name
PostPosted: Sun Sep 18, 2011 8:44 pm 
Offline

Joined: Fri Dec 09, 2005 6:25 pm
Posts: 357
When I save a text file with a different extension, such as ".srt", Windows seems to want to add a ".txt" extension to the file. Is there a way to prevent this? Wondering if it's just a result of the computer not recognizing the ".srt" extension and it adding ".txt" since it's a text file? If that is the case, do I need to somehow add this file association in the installer?


Top
 Profile  
Reply with quote  
 Post subject: Re: Windows adds ".txt" to file name
PostPosted: Mon Sep 19, 2011 2:12 am 
Offline

Joined: Mon May 30, 2011 12:56 am
Posts: 702
Sounds like the default extension property kicking in.
How are you presenting the file selector dialog?


Create a file type that has set as the extension
call it myfiletype or whatever floats your boat

then:

Dim dlg as OpenDialog
dlg= New OpenDialog
dlg.InitialDirectory = somefolder
dlg.Filter=FileTypes.MyFileType
f=dlg.ShowModal

with perhaps:

if right(f.absolutepath,4) <> ".srt" then
// add .srt to the end of the filename if you want to be sure
end if

if right(f.absolutepath,4) = ".txt" then
// change .txt to be .srt if there is a chance that you reach this point somehow
end if


Top
 Profile  
Reply with quote  
 Post subject: Re: Windows adds ".txt" to file name
PostPosted: Mon Sep 19, 2011 7:48 am 
Offline

Joined: Fri Dec 09, 2005 6:25 pm
Posts: 357
thanks, kermit. I'll give that a whirl.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 5 hours


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

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group