Hi Emile,

Great tip! But are you saying that the Linux and Mac built apps worked differently with your original code?

Tim
--
Tim Jones
[EMAIL PROTECTED]

On Jan 3, 2007, at 2:24 AM, Emile SCHWARZ wrote:

Hi all,

REALbasic 2006 Release 4
MacOS X 10.4.8
Novell suse linux 10.1


For once, this is linux this contest winner!

In fact, under MacOS X (I forget to test that under Windows), I use a technik to always open the dialog in the last opened folder (except the first time, I open it in the application directory.

To do that, I have two window properties: gOpenFI and gSaveFI (original, isn't it ?). And the used code is... where the problem lies under linux.

After I found the trouble I was feeling sad: it was my error. The offending code lies in the SaveAsDialog.InitialDirectory (and strangely, I do not have that trouble in the OpenDialog.InitialDirectory) who know why ?


// part of code that fills the SaveAsDialog.InitialDirectory property:
  If gSaveFI = Nil Then
    // First Save Operation: use the Application folder
    SaveDlg.InitialDirectory = App.AppFI
  Else
    // Other Save Operations: use the last saved value
    SaveDlg.InitialDirectory = gSaveFI
  End If

  // .../... later just before the end of the code:

  // Store the just used Folder (to save data)
  gSaveFI = SaveFI


and here lies the trouble: I pass a FolderItem _TO_ an item, not to a folder (say directory to be more expressive).

Changing that to:


  // Store the just used Folder (to save data)
  gSaveFI = SaveFI.Parent



resolve the trouble!

Mea culpa, mea culpa, mea maxi mea culpa (if I recall correctly)!

After a simple test, both Open and Save operations works using:

  gSaveFI = SaveFI.Parent

  gOpenFI = OpenFI.Parent

[I created a folder with 'Open' in its name, another with 'Save' in its name, open a file from there once, and a second attempt opens the correct folder; same for Save.]

FWIW,

Emile


PS: On MacOS X, apparently, a "special coercion" (or a stip of the file name) can be done (behind my back) and so it works _BUT_ IMHO must not for an obvious reason _AND_ this is not on par with what linux does (which is the right thing, still IMHO!).
_______________________________________________
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>

Reply via email to