%
%  Name:  savesession
% 
%  Usage: savesession
% 
%   Description:
%      Opens a dialog box 
%
%      'cdir' is the directory to start in

%  Version SWD960719
%
%  Author(s): Phillip Cornwell, cornwell@lanl.gov
%
%  Institution: Los Alamos National Laboratory,
%               ESA-EA
%
%  Copyright (c) 1996, The Regents of the University
%       of California. (See top level of code for
%       full copyright statement.)
%

%
%   Don't Save Handles to session file
%

temp1 = onHndlVector;
temp2 = hndlMatrix;
temp3 = hcx2rl;

clear onHndlVector hndlMatrix hcx2rl

%
%  Set file suffix filter
%

csuf = '*_sess.mat';

%
%  Append directory to filter
%

if cdir(length(cdir)) ~= '/',
    cdir = [cdir,'/'];
end

cfilt = [cdir,csuf];

%
%  Call the gui file save function
%

[filename,pathname] = uiputfile(cfilt,'DIAMOND: SaveSession',150,150);

if filename == 0 | filename == '',
   error = 1;
else
   error = 0;
end

if error==0,
   filetosave=[pathname,filename];
   eval(['save ' filetosave,';']);
end

onHndlVector = temp1;
hndlMatrix = temp2;
hcx2rl = temp3;

return
