New topic: 

Save file as html

<http://forums.realsoftware.com/viewtopic.php?t=47998>

         Page 1 of 1
   [ 10 posts ]                 Previous topic | Next topic          Author  
Message        dhernandez          Post subject: Save file as htmlPosted: Tue 
May 28, 2013 9:07 am                         
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                DaveS          Post subject: 
Re: Save file as htmlPosted: Tue May 28, 2013 9:18 am                           
      
Joined: Sun Aug 05, 2007 10:46 am
Posts: 4922
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                dhernandez          Post 
subject: Re: Save file as htmlPosted: Tue May 28, 2013 9:40 am                  
       
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   
                             Top                DaveS          Post subject: 
Re: Save file as htmlPosted: Tue May 28, 2013 9:47 am                           
      
Joined: Sun Aug 05, 2007 10:46 am
Posts: 4922
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                dhernandez          Post 
subject: Re: Save file as htmlPosted: Tue May 28, 2013 11:12 am                 
        
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                DaveS          Post subject: 
Re: Save file as htmlPosted: Tue May 28, 2013 11:20 am                          
       
Joined: Sun Aug 05, 2007 10:46 am
Posts: 4922
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                dhernandez          Post 
subject: Re: Save file as htmlPosted: Tue May 28, 2013 11:31 am                 
        
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                Dale          Post subject: Re: 
Save file as htmlPosted: Tue May 28, 2013 2:30 pm                               
  
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                dhernandez          Post 
subject: Re: Save file as htmlPosted: Tue May 28, 2013 3:29 pm                  
       
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                timhare          Post subject: 
Re: Save file as htmlPosted: Tue May 28, 2013 4:24 pm                         
Joined: Fri Jan 06, 2006 3:21 pm
Posts: 12379
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             Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 10 posts ]      
-- 
Over 1500 classes with 29000 functions in one REALbasic plug-in collection. 
The Monkeybread Software Realbasic Plugin v9.3. 
http://www.monkeybreadsoftware.de/realbasic/plugins.shtml

[email protected]

Reply via email to