function ShowData(x,S,h,g,nS,Par,rec)

% Definitions

NULL            = 0;
INIT            = 1;
OUTERLOOP       = 2;
INNERLOOP       = 3;
NEWTONLOOP      = 4;
END_INNERLOOP   = 5;
FINAL_SOLUTION  = 6;

TRUE  = 1;
FALSE = 0;

n  = length(x);     %	Number of Variables
nh = size(h,1);     %	Number of Equality Constraints
ng = size(g,1);     %	Number of Inequality Constraints

xs = '';
for k = 1: n
    xs =  sprintf('%s %g',xs,x(k));
end

if Par.status == INIT 

 		if ~rec,
			disp('=========================================================================')
			disp('Initialization:')
			disp(' ')
			str = sprintf(' Initial Point        x0    = [%s ]',xs);
			disp(str);
			str = sprintf(' Objective Function   S(x0) = %g ',S);
			disp(str);
    
			if nh > 0
				disp(' ')
				disp('Equality Constraints:')
				disp(' ')

				for i = 1: nh
            	if (abs(h(i)) > Par.tol)
               	str = sprintf(' Point x0 is Infeasible in h(%d) = %g ',i,h(i));
               	disp(str);
            	else
               	str = sprintf(' Point x0 is Feasible in h(%d) = %g ',i,h(i));
               	disp(str);
            	end
    			end
    		end
    
    		if ng > 0

        		disp(' ')
        		disp('Inequality Constraints:')
        		disp(' ')

        		for i = 1: ng
            	if (g(i) < Par.tol)
               	str = sprintf(' Point x0 is Feasible in g(%d) = %g ',i,g(i));
               	disp(str);
            	else
               	str = sprintf(' Point x0 is Infeasible in g(%d) = %g ',i,g(i));
               	disp(str);
            	end
        		end
    		end
          disp('=========================================================================')
          disp(' ');
    		Par.status = NULL;
       end

elseif Par.status == OUTERLOOP
   
   Par.status = NULL;
   
elseif Par.status == FINAL_SOLUTION
    
	 disp('================================================================================================')

    if Par.n2gd < Par.tol & Par.feasible
        disp('Optimun Solution:')
        disp(' ')
        str = sprintf(' Optimun Point                  x = [%s ]',xs);
        disp(str);
        str = sprintf(' Optimun Objective Function S(x)  = %g ',S);
        disp(str);
        str = sprintf(' Number of Obj. Func. Evaluations = %d ',nS);
        disp(str);
%        disp(' ')
%        disp('Equality Constraints:')
%        disp(' ')
%        for i = 1: nh
%            str = sprintf(' h(%d) = %g ',i,h(i));
%            disp(str);
%        end
    else    
        disp('Optimun Solution Not Found:')
        disp(' ')
        str = sprintf(' Last Point x = [%s ]',xs);
        disp(str);
        str = sprintf(' Last Objective Function S(x) = %g ',S);
        disp(str);
        str = sprintf(' Last Direction of ObjFun = %g ', Par.gd);
        disp(str);
        str = sprintf(' Number of Obj. Func. Evaluations = %d ',nS);
        disp(str);
%        disp(' ')
%        disp('Equality Constraints:')
%        disp(' ')
%        for i = 1: nh
%            str = sprintf(' h(%d) = %g ',i,h(i));
%            disp(str);
%        end
    end
    
    if nh > 0
        disp(' ')
        disp('Equality Constraints:')
        disp(' ')

        for i = 1: nh
            if (abs(h(i)) > Par.tol)
                str = sprintf(' Point x is Infeasible in h(%d) = %g ',i,h(i));
                disp(str);
            else
                str = sprintf(' Point x is Feasible in h(%d) = %g ',i,h(i));
                disp(str);
            end
        end
    end
    
    if ng > 0

        disp(' ')
        disp('Inequality Constraints:')
        disp(' ')

        for i = 1: ng
            if (g(i) < Par.tol)
                str = sprintf(' Point x is Feasible in g(%d) = %g ',i,g(i));
                disp(str);
            else
                str = sprintf(' Point x is Infeasible in g(%d) = %g ',i,g(i));
                disp(str);
            end
        end
    end
        
	 disp('================================================================================================')

    Par.status = NULL;

end

Par.status = -1;
if Par.status == 0
   x
elseif Par.status == OUTERLOOP

    disp('=========================================================================')
    str = sprintf('Outer Loop: Iteration = %d ',Par.it);
    disp(str);
    Par.status = NULL;
    
elseif Par.status == INNERLOOP
    
    disp('+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++')
    str = sprintf('Inner Loop: Iteration = %d',Par.iti);
    disp(str);
    str = sprintf(' Direction ObjFun = %g ', Par.gd);
    disp(str);
    str = sprintf(' Iterations on Line Search = %d , alfa = %g', Par.itn,Par.alfa);
    disp(str);
    Par.status = NULL;
    
elseif Par.status == NEWTONLOOP
    
%        disp('Newton Loop:')
    disp(' ')
    str = sprintf(' Point x = [%s ]',xs);
    disp(str);
    str = sprintf(' Objective Function S(x) = %g ',S);
    disp(str);
    
    if nh > 0
        disp(' ')
        disp('Equality Constraints:')
        disp(' ')

        for i = 1: nh
            if (abs(h(i)) > Par.tol)
                str = sprintf(' Point x is Infeasible in h(%d) = %g ',i,h(i));
                disp(str);
            else
                str = sprintf(' Point x is Feasible in h(%d) = %g ',i,h(i));
                disp(str);
            end
        end
    end
    
    if ng > 0

        disp(' ')
        disp('Inequality Constraints:')
        disp(' ')

        for i = 1: ng
            if (g(i) < Par.tol)
                str = sprintf(' Point x is Feasible in g(%d) = %g ',i,g(i));
                disp(str);
            else
                str = sprintf(' Point x is Infeasible in g(%d) = %g ',i,g(i));
                disp(str);
            end
        end
    end
    Par.status = NULL;
    
elseif Par.status == END_INNERLOOP

    disp('+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++')
    Par.status = NULL;

end
