Dlog-Load user pref radio

From Vectorlab
Jump to: navigation, search


Function to load the last used radio choice from the file "SavedSettingsUser.xml", setting the chosen radio item, if it fails it will set the choice specified as default. You need the routine D_LoadUserPrefNum to be loaded first. By Orso B. Schmid


{ Orso B. Schmid ************************************************ }
{ loads last used radio choice from SavedSettingsUser/XML, returns the item selected, uses a default value }
FUNCTION D_LoadUserPrefRad(XMLcategory, XMLelem: STRING; defaultSel: LONGINT): LONGINT;
	VAR
		temp_L : LONGINT;
	BEGIN
		temp_L := D_LoadUserPrefNum(XMLcategory, XMLelem, 0);
		IF temp_L = 0 THEN
			temp_L := defaultSel;
		
		SetItem(temp_L, TRUE);
		D_LoadUserPrefRad := temp_L;
	END;