function y = return_val(s, x)

%--------------------------------------------------------------------
%     Copyright (C) J. V. Mansbridge, CSIRO, 
% CHANGE   1.1 92/01/30
%
% function y = return_val(s, x)
%
% DESCRIPTION:
%
% return_val asks the user to type in a number.  It returns the same
% number unless the user hits the carriage return in which case a
% default is returned.
% 
% INPUT:
% s is a string that is written to the user's terminal as a prompt.
% x is the default number that is returned if the user simply hits
% the carriage return.
%
% OUTPUT:
% y is the returned number.  It is either the same number that the
% user put in or a default.
%
% EXAMPLE:
% y = return_val('Type in the ocean depth in metres [6000] ...', 6000);
%
% CALLER:   getcdf.m
% CALLEE:   none
%
% AUTHOR:   J. V. Mansbridge, CSIRO
%---------------------------------------------------------------------

% @(#)return_val.m   1.1   92/01/30
% 
%--------------------------------------------------------------------

xtemp = input(s);
if isempty(xtemp)
   y = x;
else
   y = xtemp;
end
