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: Eirik Karlsen <eikarlse at online dot no>
Date: Mon, 30 May 2005 01:42:54 +0200
Delivered-to: gettingstarted at lists dot realsoftware dot com
References: <b533cb2210462b7e6bb558e4c3c92a12 at spamcop dot net>
You could get some help from this code (it works for me):
'*************
  '------------------- Save preferences to ini-file -----------------
  Dim TempOut As Variant   'For crosslinking datatypes
  Dim ConfigFile As FolderItem
  Dim fileStream As TextOutputStream
  ConfigFile=GetFolderItem("config.ini")
  fileStream=ConfigFile.CreateTextFile
  '------------- Header ----------------------------------------------
  fileStream.WriteLine "Machine generated file...Do NOT edit !"
  fileStream.WriteLine "UEGO configuration settings:"
  '-------------------------------------------------------------------
'***************



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

--
*******************************************
VISIT MY HOME PAGE:
<http://home.online.no/~eikarlse/index.htm>
LAST UPDATED: 23/08/2003
*******************************************
Regards
Eirik Karlsen

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