news
About Elegant Chaos
info
About me and my friends
people
Software from Elegant Chaos
software
Other stuff...
stuff

FL_FindPrefs

Revision 2
Revised on 19/03/95 18:02

Description

Find a preferences file. Takes the name of the preferences file to find.

This routine looks for the file first in the Preferences folder in the ULTRALAB folder, within the current system folder.

If it can't find it there, it also looks in the normal system preferences folder.

If it finds the file somewhere, it returns the path to it. If it can't find it, it returns the path where the file should be created, which will be in the ULTRALAB preferences folder.


Code

function FL_FindPrefs name
  -- look for file in ULTRALAB folder first
  put FindFolder("system folder") & "ULTRALAB:Preferences:" & name into preferredPath
  
  -- if it's there, return that as path
  if there is a file preferredPath then
    return preferredPath
  end if
  
  -- otherwise, look in the proper preferences folder
  put FindFolder("preferences") & name into otherPath
  
  -- if its there, return that path
  if there is a file otherPath then
    return otherPath
    
  else
    -- file doesn't exist, so make sure its created in the preferred place
    return preferredPath
  end if
  
  
end FL_FindPrefs