Dlog-Load user pref string

From Vectorlab
Jump to: navigation, search


Function to retrive user preferences from the file "SavedSettingsUser.xml", if it fails it will return a default value. The preferences must be set beforehand using the routine "SetSavedSetting". By Orso B. Schmid


{ Orso B. Schmid ************************************************ }
{ loads whatever user setting from SavedSettingsUser/XML: STRING }
{ if this fails, it sets a predefined default value }
FUNCTION D_LoadUserPrefStr(XMLcategory, XMLelem, defVal: STRING): STRING;
	VAR 
		value : STRING; 
		
	BEGIN
		D_LoadUserPrefStr := defVal;
		
		IF GetSavedSetting(XMLcategory, XMLelem, value) THEN
			D_LoadUserPrefStr := value;
	END;