Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Thu Oct 17, 2019 6:37 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Trouble with FileTypes
PostPosted: Thu Oct 20, 2011 7:50 am 
Offline

Joined: Fri Dec 09, 2005 6:25 pm
Posts: 357
I'm porting my app to Windows and have run across a problem in testing. I have a method that creates a text file of everything that's in my listbox. I am using the following code

file=GetSaveFolderItem("TEXT",newFileName + "transcripts.txt")


which works just fine on the Mac, but on Windows 7 (and on only one computer that I know of yet) it is instead using my project file FileType and instead of getting a ".txt" extension, it's getting a ".mcp" extension. MCP is the first FileType I have listed in my FileTypes. In addition to that, it seems to be garbliing the text into something unreadable like this (binary possibly?):

67&óG2ˆbDTBF∆≤g&ˆ“GV◊vV'6óFR÷F˜vÊ∆ˆBFW7@–†–¢ñbñ˜R∆ˆˆ≤BFÜR6Ü'BBFÜRF˜ÜW&R


Should I be filtering in a more specific way? Does Windows not see TEXT as a viable filetype? And why would this only occur on one computer and not another? It worked fine when I tested it on my XP and Win 7 machines.


Top
 Profile  
Reply with quote  
 Post subject: Re: Trouble with FileTypes
PostPosted: Thu Oct 20, 2011 7:59 pm 
Offline

Joined: Mon Mar 21, 2011 5:17 pm
Posts: 13
Location: Southeast, USA
pbesong wrote:
...but on Windows 7 (and on only one computer that I know of yet) it is instead using my project file FileType and instead of getting a ".txt" extension

I could be wrong but I believe you actually have to pass it an instance of the FileType class. At least, that is what I see in the docs and what I have always done.

If your FileType class is named FileTypes1 and you have added a text type with an object name of Text:
file=GetSaveFolderItem(FileTypes1.Text, "transcripts.txt")

pbesong wrote:
In addition to that, it seems to be garbliing the text into something unreadable like this (binary possibly?)

Perhaps it is using binary because it is confused about the file type you intended to save as. That may clear up once you've clarified the file type as described above. If not, you may need to examine the method you are using to write the data to the text file.

RB docs: FileType

_________________
Dual booting Win7 Ultimate x64, Ubuntu 11.04
Real Studio Professional 2011 Release 3


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 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:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group