I curious if Xojo has a way that you can create a text file, append data to it, then open that text file all in a console application?
So far i have all the code to generate a text file with data in it, now im trying to open that file for verification that the data was inserted properly.
All of this is done on a Window’s machine but im willing to see the code for any operating system if it is Windows compatible.
dim f as FolderItem=SpecialFolder.Desktop.child("mytest.txt")
dim txt_out as TextOutputStream
txt_out=TextOutputStream.Append(f)
txt_out.writeline "data"
txt_out.close
i did and none of it is working for me. Again i want to point out that i am using a CONSOLE application and when i use the FolderItem.Launch i get the error message of: “Type FolderItem has no member named ‘Launch’”
As for if i looked into the LangRef, again, yes i did and yes the TextInput and Output streams work for reading in the data i want to physically open the text file for viewing. i want Xojo to use the computer’s default program to open a text file.
So in this instance i want my console application to write data to a txt document. then open that very txt document in NotePad.
FUNCTION launch(extends f as folderitem)
Dim cmd As String
Dim sh As New shell
#If TargetMacOS Then
cmd="OPEN"
#ElseIf TargetWindows Then
cmd="START"
#Else
Print "Launch feature not available for this OS"
Return
#EndIf
sh.Execute cmd+" "+f.shellpath
END FUNCTION