can't create tos file

Hi All. Having a little issue here.

I am trying to create a textoutputstream, however I keep getting an error

This item does not exist Dim myOutputFile as FolderItem = FolderItem.ShowSaveFileDialog(FileTypes1.text,"MySample.txt")

I think it has to do with the fact I can’t get a completion on “ShowSaveFileDialog”.

Here is my code (so far):

[code]Dim dialog As OpenDialog
Dim file As FolderItem
Dim tis As TextInputStream
dim tos as TextOutputStream
Dim myRowCount, MyColumncount, i, j as integer
Dim rowFromFile as string
Dim oneCell as string
Dim myOutputFile as FolderItem = FolderItem.ShowSaveFileDialog(FileTypes1.text,“MySample.txt”)
newSeparator = chrB(9)

dialog = New OpenDialog
dialog.Filter = “text/plain”

// The OpenDialog class supports custom prompts
dialog.PromptText = “Select your csv”

// and custom titles
dialog.Title = “CSV Groomer”

// For regular modal dialogs, just call dlg.showModal

file = dialog.ShowModal
tis = TextInputStream.Open(file)[/code]

Regards

Which Xojo Version do you use? ShowSaveFileDialog was introduced with API 2.0. so you can use it only with Xojo >= 2019.02.

What is Filetypes1.text? If that is supposed to be a file type in the FileTypes1 set (FileTypeGroup1 in 2019r2) then you need to specify it by name rather than the name of the set.

Hi all.

Martin, I am running 2019r1.1. Guess it is time to upgrade!
Dale. Filetype1.text is declared so when I go into the Save Dialog Box (COMING SOON!!!) so I only see the files I want.

Regards

Nice, but where in the shared code above do you use it ?

Hi Emile.

I am using that in a Pushbutton Action.

Regards

Thank you, but you said TOS does not works when you do not use it(in the code you shared)…

Read there:

http://documentation.xojo.com/api/files/textoutputstream.html