This method has been deprecated. Please refer to ENVIPreferences.
The GetPreference function method returns the current value of an ENVI preference setting.
Example
e = ENVI()
file = FILEPATH('qb_boulder_msi', ROOT_DIR=e.ROOT_DIR, $
SUBDIRECTORY = ['data'])
raster = e.OpenRaster(file)
origData = raster.GetData(BANDS=0)
outDir = e.GetPreference('OUTPUT_DIRECTORY')
newRaster = outDir + 'newFile.dat'
newFile = ENVIRaster(origData, URI=newRaster, NBANDS=1)
newFile.Save
view = e.GetView()
layer = view.CreateLayer(newFile)
Syntax
Result = ENVI.GetPreference(Name [, ERROR=variable])
Arguments
Name
A scalar string that corresponds to a given preference. The string value is not the same as the preference name in the Preferences dialog of the ENVI user interface. The following table lists the valid strings for the Name argument and their corresponding preferences:
Keywords
Keywords are applied only during the initial creation of the object.
ERROR
Set this keyword to a named variable that will contain any error message issued during execution of this routine. If no error occurs, the ERROR variable will be set to a null string (''). If an error occurs and the routine is a function, then the function result will be undefined.
When this keyword is not set and an error occurs, ENVI returns to the caller and execution halts. In this case, the error message is contained within !ERROR_STATE and can be caught using IDL's CATCH routine. See IDL Help for more information on !ERROR_STATE and CATCH.
See Manage Errors for more information on error handling in ENVI programming.
Version History
ENVI 5 |
Introduced |
ENVI 5.2 |
Deprecated |
See Also
ENVI