Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Fri May 26, 2017 10:08 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: Save file as html
PostPosted: Tue May 28, 2013 9:07 am 
Offline

Joined: Tue Apr 09, 2013 3:09 pm
Posts: 24
Location: Reynosa, Tamps. Mexico
Good morning to all.
Again I have a problem, I am using RS Enterprise 2012 and am working on a project for the web.
What I do is the following:
In an HTML TextArea write. That code I want to save it in a file .HTML or HTM ​​and it is in this way the index.html file in the path that I want.
I only managed to save it in plain text, but I saved as a text. Txt and want to save it as .Html

I'm working under Windows 7.. Help Me!


Top
 Profile  
 
 Post subject: Re: Save file as html
PostPosted: Tue May 28, 2013 9:18 am 
Offline
User avatar

Joined: Sun Aug 05, 2007 10:46 am
Posts: 4931
Location: San Diego, CA
confused.....

HTML *IS* plain text

you have full control of the file name you create (I assume you are using TEXTOUTSTREAM and FOLDERITEM)

_________________
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  
 
 Post subject: Re: Save file as html
PostPosted: Tue May 28, 2013 9:40 am 
Offline

Joined: Tue Apr 09, 2013 3:09 pm
Posts: 24
Location: Reynosa, Tamps. Mexico
You have reason, HTML is text ... The only difference between TXT and HTML is that the former can not be executed and the HTML itself. What I want is saved directly to termination HTML file and not have to manually change the extension ...

I do not know if I explain :o


Top
 Profile  
 
 Post subject: Re: Save file as html
PostPosted: Tue May 28, 2013 9:47 am 
Offline
User avatar

Joined: Sun Aug 05, 2007 10:46 am
Posts: 4931
Location: San Diego, CA
so save it with ".HTML" extension

please post you code .... there is no reason that you cannot save the file with any extenstion you desire


and to be correct.... HTML cannot be "executed"... it can be interpeted..... the only difference is the extenstion... nothing else

_________________
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  
 
 Post subject: Re: Save file as html
PostPosted: Tue May 28, 2013 11:12 am 
Offline

Joined: Tue Apr 09, 2013 3:09 pm
Posts: 24
Location: Reynosa, Tamps. Mexico
here is the code I use.

Dim f As FolderItem
Dim stream As TextOutputStream

f=GetSaveFolderItem(FileTypes1.All, "Index.html")
FileTypes1.All
If f <> Nil then
stream = TextOutputStream.Create(f)
f.CreateAsFolder = "ttxt"
Stream.WriteLine(Code.text)
Stream.Close
End If


Top
 Profile  
 
 Post subject: Re: Save file as html
PostPosted: Tue May 28, 2013 11:20 am 
Offline
User avatar

Joined: Sun Aug 05, 2007 10:46 am
Posts: 4931
Location: San Diego, CA
remove this

f.CreateAsFolder = "ttxt"

_________________
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  
 
 Post subject: Re: Save file as html
PostPosted: Tue May 28, 2013 11:31 am 
Offline

Joined: Tue Apr 09, 2013 3:09 pm
Posts: 24
Location: Reynosa, Tamps. Mexico
Realize what you said, but this error is the brand I ..

http://imageshack.us/f/694/error1b.png/

http://imageshack.us/f/593/error2uk.png/


Top
 Profile  
 
 Post subject: Re: Save file as html
PostPosted: Tue May 28, 2013 2:30 pm 
Offline
User avatar

Joined: Thu Mar 01, 2007 2:02 pm
Posts: 237
Location: Sunny (generally!) Southern California
Probably a silly question but did you add the FileTypes1 item in the Project tab?

- Dale

_________________
-----
Real Studio 2012r1 on Windows 7 (64 bit)
-----
It has been said that politics is the second oldest profession.
I have learned that it bears a striking resemblance to the first.
- Ronald Reagan


Top
 Profile  
 
 Post subject: Re: Save file as html
PostPosted: Tue May 28, 2013 3:29 pm 
Offline

Joined: Tue Apr 09, 2013 3:09 pm
Posts: 24
Location: Reynosa, Tamps. Mexico
Yes
I have added the item FileTypes1 not understand why the failure. :?:


Top
 Profile  
 
 Post subject: Re: Save file as html
PostPosted: Tue May 28, 2013 4:24 pm 
Offline

Joined: Fri Jan 06, 2006 3:21 pm
Posts: 12388
Location: Portland, OR USA
GetSaveFolderItem is for desktop apps, not web. Use the Webfile class and its related functions to create a downloadable file and allow the user to save it to his computer.


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

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 4 guests


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