gettingstarted
[Top] [All Lists]

RE: Save with no dialog after Save As...

To: "'Getting Started'" <gettingstarted at lists dot realsoftware dot com>
Subject: RE: Save with no dialog after Save As...
From: "POIDINGER, Michael [JJRAU]" <MPOIDING at MEDAU dot JNJ dot com>
Date: Mon, 30 May 2005 09:45:41 +1000
Delivered-to: gettingstarted at lists dot realsoftware dot com
> -----Original Message-----
> From: gettingstarted-bounces at lists dot realsoftware dot com 
> [mailto:gettingstarted-bounces at lists dot realsoftware dot com] On 
> Behalf Of Barrie Jones
> Sent: Monday, May 30, 2005 9:39 AM
> To: RealBasic getting Started
> Subject: Save with no dialog after Save As...
> 
> 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?
> 

TO re-iterate what Erik just said,
Use GetFolderItem to return a FolderItem object without user interaction.
The folderitem object then has a number of open as and save as methods.

Have a look at getfolderitem and folderitem in the online help

HTH
Mike
_______________________________________________
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>

<Prev in Thread] Current Thread [Next in Thread>