Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Fri Dec 15, 2017 3:13 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Saving textarea and pasting code
PostPosted: Wed Apr 24, 2013 7:20 am 
Offline

Joined: Tue Dec 11, 2012 12:49 pm
Posts: 3
It must be really simple, but I can't find a solution for my problem.

I am creating a CSV editor for simple things as replacing ; to , and removing ".
That all works fine. But now I want to save the text area.
How do I add a sugested name and fix it to the standard extension "csv"?

This doesn't work:

Dim f As FolderItem
Dim dlg As SaveAsDialog
//create a new SaveAsDialog
'dlg.SuggestedFileName = window1.Title
dlg.filter = "TextTypes.csv"
dlg = New SaveAsDialog
//Run it
'f = new folderitem (window1.title)
f = dlg.ShowModal
//check to see if the user clicked cancel
If f <> Nil Then
//save the TextArea
Call TextArea1.Save(f, false)
End If


And another thing: If I copy some code from the internet or from the help function, realstudio puts everything in one line, instead of the separate lines of code. How can I fix this?

Thanks,
Bert


Top
 Profile  
Reply with quote  
 Post subject: Re: Saving textarea and pasting code
PostPosted: Wed Apr 24, 2013 7:46 am 
Offline

Joined: Fri Apr 19, 2013 2:08 am
Posts: 5
I believe the Filter is used to grey out some of the files in the SaveAsDialog and not for the extension. Also, you are setting the filter before instantiating with "New" and you should use FilterTypes instead of assigning a string.

To get around the "csv" file type issue, you should introduce SuggestedFilename, so here is your code with 1 or 2 minor changes:

Dim f As FolderItem
Dim dlg As new SaveAsDialog
//create a new SaveAsDialog
'dlg.SuggestedFileName = window1.Title
dlg = New SaveAsDialog
'dlg.filter = "TextTypes.csv"
dlg.SuggestedFileName="Untitled.csv"

//Run it
'f = new folderitem (window1.title)
f = dlg.ShowModal
//check to see if the user clicked cancel
If f <> Nil Then
//save the TextArea
Call TextArea1.Save(f, false)
End If


Top
 Profile  
Reply with quote  
 Post subject: Re: Saving textarea and pasting code
PostPosted: Wed Apr 24, 2013 8:34 am 
Offline

Joined: Tue Dec 11, 2012 12:49 pm
Posts: 3
Thanks. I solved it before reading you post :)
I found out that puting the code in the right sequence also helped a lot.

Bert.


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:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group