>  Docs Center  >  ENVI API  >  Application Control  >  ENVIPreferenceItem::Save

ENVIPreferenceItem::Save

ENVIPreferenceItem::Save

This Save method saves the value of an individual preference to the ENVI preferences file. It saves only the individual value of the preference and not other preferences that have been modified in the API.

Example


; Launch ENVI
e = ENVI()
 
; Update the Overview's border color to cyan and save it.
prefItem = e.Preferences['overview:border color']
 
prefItem.VALUE=[0,255,255]
 
prefItem.Save

Syntax


ENVIPreferenceItem.Save [, Keywords=value]

Arguments


None

Keywords


URI

Set this keyword to the name of a JSON file where preferences will be saved. If this keyword is not specified, preferences will be saved to the JSON file specified by the ENVIPreferences object URI property.

If preferences are saved in a location other than the default JSON file, they will not be loaded when ENVI is launched in future sessions. To load preferences from a location other than the default, call ENVIPreferences::Load with the specified URI. To override the default preferences file throughout the ENVI application (including where preferences are automatically saved) specify the PREFERENCES keyword of ENVI function when launching ENVI.

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.2

Introduced

API Version


3.3

See Also


ENVI, ENVIPreferenceItem, ENVIPreferences, ENVIPreferences::Load, ENVIPreferences::Save



© 2019 Harris Geospatial Solutions, Inc. |  Legal
My Account    |    Store    |    Contact Us