;+ ; NAME: keep_compatibility ; ; PURPOSE: ; 1) define key_forgetold = 1b - keyword_set(flag) ; 2) remove all oldcm_used.pro found in !path ; 3) define and create myuniquetmpdir and add it to !path ; 4) copy oldcm_full(_empty) to myuniquetmpdir+'oldcm_used.pro' ; ; CATEGORY: compatibility with old version ; ; CALLING SEQUENCE:keep_compatibility [, flag] ; ; INPUTS: ; ; flag: 1 or 0 to keep or forget the compatibility ; dir: the directory where we create oldcm_used.pro. ; if omitted, is automatically defined to ; 1b - keyword_set(key_forgetold) ; ; COMMON BLOCKS: cm_general ; ; SIDE EFFECTS: see purpose ; ; RESTRICTIONS: copy oldcm_full or oldcm_empty must be found in the ; !path. dir must aslo be in the !path ; ; MODIFICATION HISTORY:Sebastien Masson (smasson@lodyc.jussieu.fr) ; June 2005 ; ;- PRO keep_compatibility, flag ; @cm_general ; ; version should be at least 6.0 ; IF fix(strmid(!version.release, 0, 1)) LT 6 THEN BEGIN print, ' *** ***** ***' print, ' *** ERROR ***' print, ' *** ***** ***' print, 'This version of SAXO needs at least IDL version 6.0' print, ' *** ***** ***' print, ' *** ERROR ***' print, ' *** ***** ***' return ENDIF ; IF n_elements(myuniquetmpdir) NE 0 THEN BEGIN !path = !path+ ':' + expand_path(myuniquetmpdir) return ENDIF ; if n_elements(flag) eq 0 then flag = 1b - keyword_set(key_forgetold) ; 1) automatic definition of key_forgetold key_forgetold = 1b - keyword_set(flag) ; ; 2) remove all oldcm_used.pro found in !path to_rm = find('oldcm_used') IF to_rm[0] NE 'NOT FOUND' THEN file_delete, to_rm ; ; 3) define and create myuniquetmpdir and add it to !path def_myuniquetmpdir ; ; 4) copy oldcm_full(_empty) to myuniquetmpdir+'oldcm_used.pro' ; select which file should be copied to oldcm_used.pro IF key_forgetold THEN BEGIN oldcm = find('oldcm_empty') print, 'We forget the compatibility with the old version' ENDIF ELSE BEGIN oldcm = find('oldcm_full') print, 'We keep the compatibility with the old version' ENDELSE ; oldcm = oldcm[0] IF oldcm EQ 'NOT FOUND' THEN BEGIN print, 'Error: oldcm_full or oldcm_empty must be found in the !path' stop ENDIF ; copy file_copy, oldcm, myuniquetmpdir + 'oldcm_used.pro', /overwrite ; ; make sure we can make the plots enev if we are using the demo mode ; demomode_compatibility ; return END