source: trunk/SRC/ForOldVersion/keep_compatibility.pro @ 102

Last change on this file since 102 was 102, checked in by pinsard, 18 years ago

start to modify headers of ForOldVersion? *.pro files for better idldoc output

  • Property svn:executable set to *
File size: 2.6 KB
Line 
1;+
2; @file_comments
3;   1) define key_forgetold = 1b - keyword_set(flag)
4;   2) remove all oldcm_used.pro found in !path
5;   3) define and create myuniquetmpdir and add it to !path
6;   4) copy oldcm_full(_empty) to myuniquetmpdir+'oldcm_used.pro'
7;
8; @categories compatibility with old version
9;
10; @examples
11; IDL> keep_compatibility [, flag]
12;
13; @param flag {in}{optional} 1 or 0 to keep or forget the compatibility
14;
15; uses cm_general
16;
17; @restrictions copy oldcm_full or oldcm_empty must be found in the
18; !path. dir must also be in the !path
19;
20; @history Sebastien Masson (smasson\@lodyc.jussieu.fr)
21;                      June 2005
22;
23;-
24PRO keep_compatibility, flag
25;
26@cm_general
27;
28; version should be at least 6.0
29;
30  IF fix(strmid(!version.release, 0, 1)) LT 6 THEN BEGIN
31    print, '                   *** ***** ***'
32    print, '                   *** ERROR ***'
33    print, '                   *** ***** ***'
34    print, 'This version of SAXO needs at least IDL version 6.0'
35    print, '                   *** ***** ***'
36    print, '                   *** ERROR ***'
37    print, '                   *** ***** ***'
38    return
39  ENDIF
40;
41  IF n_elements(myuniquetmpdir) NE 0 THEN BEGIN
42    !path = !path+ ':' + expand_path(myuniquetmpdir)
43    return
44  ENDIF
45;
46  if n_elements(flag) eq 0 then flag = 1b - keyword_set(key_forgetold)
47; 1) automatic definition of key_forgetold
48  key_forgetold = 1b - keyword_set(flag)
49;
50; 2) remove all oldcm_used.pro found in !path
51  to_rm = find('oldcm_used')
52  IF to_rm[0] NE 'NOT FOUND' THEN file_delete, to_rm
53;
54; 3) define and create myuniquetmpdir and add it to !path
55  def_myuniquetmpdir
56;
57; 4) copy oldcm_full(_empty) to myuniquetmpdir+'oldcm_used.pro'
58; select which file should be copied to oldcm_used.pro
59  IF key_forgetold THEN BEGIN
60    oldcm = find('oldcm_empty')
61    print, 'We forget the compatibility with the old version'
62  ENDIF ELSE BEGIN
63    oldcm = find('oldcm_full')
64    print, 'We keep the compatibility with the old version'
65  ENDELSE
66;
67  oldcm = oldcm[0]
68  IF oldcm EQ 'NOT FOUND' THEN BEGIN
69    print, 'Error: oldcm_full or oldcm_empty must be found in the !path'
70    stop
71  ENDIF
72; copy
73  file_copy, oldcm, myuniquetmpdir + 'oldcm_used.pro', /overwrite
74;
75; make sure we can make the plots enev if we are using the demo mode
76;
77  demomode_compatibility
78;
79;  make sure that the common variables are correctly initialized.
80;
81  IF size(ccmeshparameters, /type) NE 8 THEN BEGIN
82    computegrid, 1, 1, 1, 1, 1, 1, /fullcgrid
83@cm_4data   
84    varname = ''
85    vargrid = 'T'
86    vardate = '0'
87    varexp = ''
88    varunit = ''
89    valmask = 1.e20
90  ENDIF
91
92  return
93END
Note: See TracBrowser for help on using the repository browser.