Index: /issm/trunk/src/m/classes/@pairoptions/buildlist.m
===================================================================
--- /issm/trunk/src/m/classes/@pairoptions/buildlist.m	(revision 2391)
+++ /issm/trunk/src/m/classes/@pairoptions/buildlist.m	(revision 2392)
@@ -1,21 +1,21 @@
-function options=buildlist(options,varargin),
-%BUILDLIST - build list of options from input
+function pairoptions=buildlist(pairoptions,varargin),
+%BUILDLIST - build list of pairoptions from input
 %
 %   Usage:
-%      options=buildlist(options,varargin)
+%      pairoptions=buildlist(pairoptions,varargin)
 
 %check length of input
 if mod((nargin-1),2),
-	error('buildlist error message: an even number of options is required')
+	error('buildlist error message: an even number of pairoptions is required')
 end
 
-%go through varargin and build list of options
+%go through varargin and build list of pairoptions
 for i=1:(nargin-1)/2,
 	if ischar(varargin{2*i-1}),
-		options.list{end+1,1}=varargin{2*i-1};
-		options.list{end,2}=varargin{2*i};
+		pairoptions.list{end+1,1}=varargin{2*i-1};
+		pairoptions.list{end,2}=varargin{2*i};
 	else
 		%option is not a string, ignore it
-		disp(['pairoptions info: option number ' num2str(i) ' is not a string, it will be ignored']);
+		disp(['buildlist info: option number ' num2str(i) ' is not a string, it will be ignored']);
 		continue
 	end
Index: /issm/trunk/src/m/classes/@pairoptions/changefieldvalue.m
===================================================================
--- /issm/trunk/src/m/classes/@pairoptions/changefieldvalue.m	(revision 2392)
+++ /issm/trunk/src/m/classes/@pairoptions/changefieldvalue.m	(revision 2392)
@@ -0,0 +1,13 @@
+function pairoptions=changefieldvalue(pairoptions,field,newvalue)
+%CHANGEOPTIONVALUE - change the value of an option in an option list
+%
+%   Usage:
+%      pairoptions=changefieldvalue(pairoptions,field,newvalue)
+
+%track occurance of field
+lines=find(strcmpi(pairoptions.list(:,1),field));
+
+%replace value
+for i=1:length(lines),
+	pairoptions.list{lines(i),2}=newvalue;
+end
Index: /issm/trunk/src/m/classes/@pairoptions/deleteduplicates.m
===================================================================
--- /issm/trunk/src/m/classes/@pairoptions/deleteduplicates.m	(revision 2392)
+++ /issm/trunk/src/m/classes/@pairoptions/deleteduplicates.m	(revision 2392)
@@ -0,0 +1,25 @@
+function pairoptions=deleteduplicates(pairoptions,warn)
+%DELETEDUPLICATES - delete duplicates in an option list
+%
+%   Usage:
+%      pairoptions=deleteduplicates(pairoptions,warn)
+%
+%   if warn==1 display an info message to wan user that
+%   some of his options have been removed.
+
+%track the first occurance of each option
+[dummy lines]=unique(pairoptions.list(:,1),'first');
+clear dummy
+
+%warn user if requested
+if warn,
+	numoptions=size(pairoptions.list,1);
+	for i=1:numoptions,
+		if ~ismember(i,lines),
+			disp(['deleteduplicates info: option ' pairoptions.list{i,1} ' appeared more than once. Only its first occurence will be kept'])
+		end
+	end
+end
+
+%remove duplicates from the options list
+pairoptions.list=pairoptions.list(lines,:);
Index: /issm/trunk/src/m/classes/@pairoptions/display.m
===================================================================
--- /issm/trunk/src/m/classes/@pairoptions/display.m	(revision 2391)
+++ /issm/trunk/src/m/classes/@pairoptions/display.m	(revision 2392)
@@ -6,3 +6,16 @@
 disp(sprintf('\n%s = \n',inputname(1)));
 disp(sprintf('   type: %s',pairoptions.type));
-disp(sprintf('   options: (%ix%i)',size(pairoptions.list,1),size(pairoptions.list,2)));
+if ~isempty(pairoptions.list),
+	disp(sprintf('   list: (%ix%i)\n',size(pairoptions.list,1),size(pairoptions.list,2)));
+	for i=1:size(pairoptions.list,1),
+		if ischar(pairoptions.list{i,2}),
+			disp(sprintf('     field: %-10s value: ''%s''',pairoptions.list{i,1},pairoptions.list{i,2}));
+		elseif isnumeric(pairoptions.list{i,2}) & length(pairoptions.list{i,2})==1,
+			disp(sprintf('     field: %-10s value: %g',pairoptions.list{i,1},pairoptions.list{i,2}));
+		else
+			disp(sprintf('     field: %-10s value: (%ix%i)',pairoptions.list{i,1},size(pairoptions.list{i,2},1),size(pairoptions.list{i,2},2)));
+		end
+	end
+else
+	disp(sprintf('   list: empty'));
+end
Index: /issm/trunk/src/m/classes/@pairoptions/getfieldvalue.m
===================================================================
--- /issm/trunk/src/m/classes/@pairoptions/getfieldvalue.m	(revision 2392)
+++ /issm/trunk/src/m/classes/@pairoptions/getfieldvalue.m	(revision 2392)
@@ -0,0 +1,35 @@
+function value=getfieldvalue(pairoptions,field,varargin),
+%GETOPTION - get the value of an option
+%
+%   Usage:
+%      value=getfieldvalue(pairoptions,field,varargin)
+%
+%   Find an option value from a field. A default option
+%   can be given in input if the field does not exist
+%
+%   Examples:
+%      value=getfieldvalue(options,'caxis');
+%      value=getfieldvalue(options,'caxis',[0 2]);
+
+%some argument checking: 
+if ((nargin~=2 & nargin~=3) | (nargout~=1)),
+	help getfieldvalue
+	error('getfieldvalue error message: bad usage');
+end
+
+if ~ischar(field),
+	error('getfieldvalue error message: field should be a string');
+end
+
+%Recover option
+if nargin==3,
+	value=varargin{1};
+else
+	value='option not found';
+end
+for i=1:size(pairoptions.list,1),
+	if strcmpi(pairoptions.list{i,1},field)
+		value=pairoptions.list{i,2};
+		return
+	end
+end
Index: sm/trunk/src/m/classes/@pairoptions/getoption.m
===================================================================
--- /issm/trunk/src/m/classes/@pairoptions/getoption.m	(revision 2391)
+++ 	(revision )
@@ -1,24 +1,0 @@
-function value=getoption(pairoptions,optioname),
-%GETOPTION - get the value of an option
-%
-%   Usage:
-%      value=getoption(pairoptions,optioname)
-
-%some argument checking: 
-if ((nargin~=2) | (nargout~=1)),
-	help getoption
-	error('getoption error message: bad usage');
-end
-
-if ~ischar(optioname),
-	error('getoption error message: optioname should be a string');
-end
-
-%Recover option
-value='option not found';
-for i=1:size(pairoptions.list,1),
-	if strcmpi(pairoptions.list{i,1},optioname)
-		value=pairoptions.list{i,2};
-		return
-	end
-end
