function prnmenu(gname);
% format function prnmenu(gname);
% gname is a string file < 7 characters.
% written by E. Gallagher, January 23, 1995
% Email: Eugene.Gallagher@umb.edu
% Last revised 4/5/02; 10/19/10
ls=length(gname);
if ls>7
     gname=gname(1:7);
end
ls=length(gname);
p=menu('CHOOSE AN OPTION:',...
'View only',... 
'Print graph (Windows driver)',... 
'Print (EPS Level 2 B and W)',... 
'Print to file only (EPS Level 2 B and W)',...
'Print eps to file with 300 dpi tiff preview',...
'Print to file and send to printer (EPS Level 2 Color)',...
'Copy to Windows clipboard (metafile)',... 
'Print to Windows metafile');
t1='dos(''copy/B ';
t2='.eps lpt1 &'')';
t3='.jet lpt1 &'')';
if p==2 
     print -dwinc
elseif p > 2 & p < 7
     exf=1;nm=0;
     while exf==1
           if exist([gname '.eps'])==2;
                 ns=num2str(nm);lns=length(ns);
                 if lns+ls<8
                      gname=[gname ns];
                      ls=length(gname);
                 else
                      gname=[gname(1:(7-lns)) ns];
                      nm=nm+1;
                 end
           else
                 exf=0;
           end
     end
     if p==3
          eval(['print -deps2  ' gname]) 
          eval(['!copy/B ' gname '.eps' ' lpt1']) 
%         eval([t1 gname t2]);
          eval(['delete ' gname '.eps']) 
     elseif p==4 
          eval(['print -deps2  ' gname]) 
     elseif p==5
          eval(['print -depsc -tiff -r300 ' gname])
     else
           eval(['print -depsc2  ' gname]) 
           eval(['!copy ' gname '.eps' ' lpt1']) 
     end
elseif p==7 | p==8
      if p==7
%          Copy to Windows clipboard (metafile)
           print -dmeta
      else
           exf=1;nm=0;
           while exf==1
                 if exist([gname '.wmf'])==2;
                       ns=num2str(nm);lns=length(ns);
                       if lns+ls<8
                            gname=[gname ns];
                            ls=length(gname);
                       else
                             gname=[gname(1:(7-lns)) ns];
                             nm=nm+1;
                       end
                 else
                       exf=0;
                 end
           end 
           eval(['print ' gname ' -dmeta'])
       end
end