Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Sun Aug 25, 2019 8:37 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Writing textarea to file not working
PostPosted: Mon Aug 01, 2011 8:15 am 
Offline
User avatar

Joined: Sun Aug 12, 2007 10:10 am
Posts: 1086
Location: Boiling Springs, SC
I have the following code...

Dim f as folderitem
Dim x as String
Dim tout as textoutputstream

//parsePlist generates a valid iTunesMetaData.plist as a string
x = parsePlist(txtMetaData.Text)

f=getfolderitem("Build/iTunesMetaData.plist")
//file successfully creates...
tout=textoutputstream.create(f)
//tout.write(x) and tout.writeline(x) yeild nothing written to file except 2 carriage returns?!?!
tout.write(x)

//With or without closing the file the same is generated as above...
tout.Close


yet it refuses to "write" to the generated file. The file is successfully created by the ~.create(f) statement...I have commented the code with what is happening...
Even if replaceing the "parsePlist" function and setting x = "hello world", it still does not get written. What am I missing?

_________________
Matthew A. Combatti
Real Studio 2012 r1.2

Visit Xojo Developer's Spot!
Systems I Use:
Windows XP/Windows Vista/Windows Server 2008 r2/Windows 7/Windows 8
Mac OSX 10.5/Mac OSX 10.6/Mac OSX Server/Ubuntu/Debian/Suse/Red Hat/
Windows Server 2011/CentOS 5.4 /ReactOS/SimOS

~All Xojo Compatible~


Top
 Profile  
Reply with quote  
 Post subject: Re: Writing textarea to file not working
PostPosted: Mon Aug 01, 2011 9:09 am 
Offline
User avatar

Joined: Sun Aug 05, 2007 10:46 am
Posts: 4931
Location: San Diego, CA
are you sure X actually contains something? put a MSGBOX X in there to be sure.....

_________________
Dave Sisemore
iMac I7[2012], OSX Mountain Lion 10.8.3 RB2012r2.1
Note : I am not interested in any solutions that involve custom Plug-ins of any kind


Top
 Profile  
Reply with quote  
 Post subject: Re: Writing textarea to file not working
PostPosted: Mon Aug 01, 2011 10:51 am 
Offline
User avatar

Joined: Sun Aug 12, 2007 10:10 am
Posts: 1086
Location: Boiling Springs, SC
DaveS wrote:
are you sure X actually contains something? put a MSGBOX X in there to be sure.....



First:
Yes.. As said I've even set

X="hello world" and have tried msgbox.. I've tried everything :-/ it's suppose to work and I know it's right coding but it's not working...

Second:

As I was typing the first I cleared the RB cache folder in c:\users\admin\appdata\real studio\cache and even though it's where the precompiled plugin data goes (Windows 7).. For some reason it fixed the problem..maybe RS has msgbox function now in a separate plugin? One of the first times running the application it crashed during build... So I knew there would be a cache of the build so guess it crashed while generating an object file and somehow still used it during runtime without receiving an error?? I use vb on windows 7 and have had similar issues...

_________________
Matthew A. Combatti
Real Studio 2012 r1.2

Visit Xojo Developer's Spot!
Systems I Use:
Windows XP/Windows Vista/Windows Server 2008 r2/Windows 7/Windows 8
Mac OSX 10.5/Mac OSX 10.6/Mac OSX Server/Ubuntu/Debian/Suse/Red Hat/
Windows Server 2011/CentOS 5.4 /ReactOS/SimOS

~All Xojo Compatible~


Top
 Profile  
Reply with quote  
 Post subject: Re: Writing textarea to file not working
PostPosted: Mon Aug 01, 2011 1:35 pm 
Offline

Joined: Thu Dec 16, 2010 1:22 pm
Posts: 188
I would suspect the "/" in your file path is causing a problem.
Use
f=getfolderitem("Build")
if not f.exists then
f.CreateAsFolder
end
f=f.child("iTunesMetaData.plist")


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 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