PWB Extensions Help (ext.hlp) (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
fSetWindowWithFile
                                             Up Contents Index Back
─────PWB Extensions─────────────────────────────────────────────────────────
 
  Syntax:  flagType fSetWindowWithFile( char far *FileName);
 
  Returns: True if window successfully set or opened, false if unable to
           create new window.
 
  See:     DelFile, fChangeFile, FileNameToHandle, FileRead, FileWrite,
           fSetWindowWithFile, GetPfileFromName, pFileToBottom,
           pFileToTop, RemoveFile, Using Files
 
     The fSetWindowWithFile function finds a window for the specified
     file. This function provides the PWB behavior for switching to a
     file. If you want to always create a new window for a file, use
     NewWindow.
 
     If the file is already open, PWB makes the file the current file,
     and the window with the file the active window. If the file is not
     already open, PWB opens it. PWB uses the following sequence of
     steps to determine the window for the file. PWB stops as soon as it
     finds or creates a window.
 
       1. Search for the file in the file histories of the open windows,
          starting from the active window. If found, then switch to that
          window.
 
       2. If the Newwindow switch is set to Yes, then open a new window
          and open the file into that window.
 
       3. If the current window is an unminimized user window (not a PWB
          window), then open the file into the current window. This
          creates a file history for that window.
 
       4. If there are any unminimized user windows, then switch to the
          most recently active user window and open the file into that
          window. This creates a file history for that window.
 
       5. Open new window and open the file.
                                    -♦-