Wow, that was a quick and decisive solution.
Many thanks to Sven, Tom, Mike and Eirik.
Barrie
On May 29, 2005, at 8:30 PM, Sven E Olsson wrote:
On May 30, 2005, at 1:39, Barrie Jones wrote:
I am trying to save a file without displaying the dialog box when the
user selects Save from the file menu.
I tried to find the answer in the tutorial but it was difficult to
relate to my app.
I have set the textHasChanged flag and need to bypass
f=GetSaveFolderItem("myFileType",gFileName) in the SaveAs method.
The SaveAs method starts as follows:
Dim bs As BinaryStream
Dim f as FolderItem
f=GetSaveFolderItem("myFileType",gFileName)
If f = Nil then
// "Cancelled"
else
bs = f.CreateBinaryFile("myFileType")
if bs = nil then
MsgBox "Unable to create file"
else
// save data here
If I bypass this line: f=GetSaveFolderItem("myFileType",gFileName)
how do I get the folderItem f without displaying a dialog?
Should I use a global folderItem in the SaveAs?
Thanks
Barrie
This is related to an text editor application, I do no know what type
of app you create.....
In the Editor Window Create in Properties : Document as Folderitem
Create:
Sub SaveDocument(f as Folderitem)
if f = Nil then // Document not saved before
Create You Save Dialog box here
end if ' Nil
if f <> Nil then
Save You Fille Here using Folderitem f
Document = f
end if ' f <> nil
If the user click cancel in the dialogbox he jump to this line
End Sub
Sub OpenFile()
Open your file
Document = f
End Sub
When You open an New blank Window
Document = Nil
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
|