function staid(h,station);
%
%            Deirdre Byrne, L-DEO, 1 Dec 1995
%                 dbyrne@ldeo.columbia.edu
%
%
%  Part of the staplot package. For instructions, see sta_info.m.

global sta sections lon_var lat_var sta_var
g = [0 0 0];
if ~isempty(sta_var)
  eval(['global ' sta_var]);
  if length(eval(sta_var)) > 0
    g(1) = 1;
  end
end 
if ~isempty(lon_var)
  eval(['global ' lon_var]);
  if length(eval(lon_var)) > 0
    g(2) = 1;
  end
end
if ~isempty(lat_var)
  eval(['global ' lat_var]); 
  if length(eval(lat_var)) > 0
    g(3) = 1;
  end
end
b = [];
if nargin == 1
  for i = 1:length(sta);
    j = find ((sections(:,1) <= sta(i)) & (sections(:,2) >= sta(i)));
    n = ''; m = ''; p = '';
    if g(1), n = num2str(eval([sta_var '(sta(i))'])); end
    if g(2), m = num2str(eval([lon_var '(sta(i))'])); end
    if g(3), p = num2str(eval([lat_var '(sta(i))'])); end
    a = sprintf('sec%2i sta%s (%s, %s)   ', j, n, m, p);
    b = [b, a];
  end
else
  for i = 1:length(station)
    j = find ((sections(:,1) <= station(i)) & (sections(:,2) >= station(i)));
    n = ''; m = ''; p = '';
    if g(1), n = num2str(eval([sta_var '(station(i))'])); end
    if g(2), m = num2str(eval([lon_var '(station(i))'])); end
    if g(3), p = num2str(eval([lat_var '(station(i))'])); end
    a = sprintf('sec%2i sta%s (%s, %s)   ', j, n, m, p);
    b = [b, a];
  end
end
set(h,'string',b,'horizontalAlignment','left');
clear a b j i g n m p station
return

