% PPRESET.M
%
%    The Program PPRESET is a script that resets all the variables used by
%    the pepperpot GUI to their initial values.  Since Matlab does not
%    delete them from memory when one exits the pepperpot GUI, the PPRESET
%    script carries this out by hand.
%

    ppvars = {'ppdir'; 'ppcalfile'; 'ppdatfile'; 'ppbgfile'; 'ppproffile'; ...
        'ppcalim'; 'ppbgim'; 'ppim'; 'ppprofim'; 'midpos'; 'sp2sp'; 'imtilt'; ...
        'ppbitdiv'; 'zlen'; 'energy'; 'ppposdat'; 'ppemitdat'; 'pppixemit5d'; ...
        'pppixemit2d'; 'ppemithist'} ;

    for i = 1:length(ppvars)
        if exist(ppvars{i},'var')
            eval(['clear global ' ppvars{i} ' ; ']) ;
            eval(['global ' ppvars{i} ' ; ']) ;
        else
            eval(['clear global ' ppvars{i} ' ; ']) ;
        end
    end

    clear i ppvars ;

    return
