Changeset 226 for trunk/SRC/Colors
- Timestamp:
- 03/16/07 10:22:26 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/Colors/newpalette.pro
r163 r226 2 2 ;+ 3 3 ; 4 ; @file_comments 4 ; @file_comments 5 5 ; Allows to save the palette which is on the screen 6 6 ; in a same type file than the one given by default in IDL 7 7 ; 'colors1.tbl'. 8 8 ; 9 ; @categories 9 ; @categories 10 10 ; Color 11 11 ; … … 13 13 ; a string containing the name of the new palette we want to write. 14 14 ; 15 ; @keyword OVER 15 ; @keyword OVER 16 16 ; the number of the palette we want to replace 17 17 ; … … 19 19 ; The file containing the color palettes. It can be in any directory of the !path. 20 20 ; 21 ; @keyword _EXTRA 21 ; @keyword _EXTRA 22 22 ; Used to pass modifyct keywords 23 23 ; … … 45 45 ; is nametbl belongs to the same effective user ID (UID) as the IDL process? 46 46 IF !d.name EQ 'X' THEN BEGIN ; works only for unix tye machine 47 IF file_test(nametbl, /user) NE 1 THEN BEGIN 48 noanswer = report('The file '+nametbl+' is not yours... Do you want to copy '+nameshort+' in your MyIDL di ectory: '+homedir+' ?', /default_no, /question)49 IF noanswer THEN return ELSE BEGIN 47 IF file_test(nametbl, /user) NE 1 THEN BEGIN 48 noanswer = report('The file '+nametbl+' is not yours... Do you want to copy '+nameshort+' in your MyIDL directory: '+homedir+' ?', /default_no, /question) 49 IF noanswer THEN return ELSE BEGIN 50 50 file_copy, nametbl, homedir ; copy the file 51 51 nametbl = homedir + nametbl ; update its name … … 54 54 ENDIF 55 55 ; no file nametbl found 56 ENDIF ELSE BEGIN 56 ENDIF ELSE BEGIN 57 57 nametbl = file_basename(namesave) ; get back the original nametbl 58 noanswer = report('The file '+nametbl+' was not found !path directories... Do you want to create such a file in your MyIDL di ectory: '+homedir+' ?', /default_no, /question)58 noanswer = report('The file '+nametbl+' was not found !path directories... Do you want to create such a file in your MyIDL directory: '+homedir+' ?', /default_no, /question) 59 59 if NOT noanswer then return 60 nameorg = filepath('colors1.tbl', subdir = ['resource', 'colors']) 60 nameorg = filepath('colors1.tbl', subdir = ['resource', 'colors']) 61 61 file_copy, nameorg, homedir 62 ENDELSE 62 ENDELSE 63 63 ; is nametbl writable? 64 64 IF file_test(nametbl, /write) NE 1 THEN file_chmod, nametbl, /u_write 65 65 ; make sure that we will really use nametbl name even if _EXTRA keyword is used 66 if n_elements(ex) NE 0 then $ 66 if n_elements(ex) NE 0 then $ 67 67 if (where(tag_names(ex) EQ 'FILE'))[0] NE -1 then ex.FILE = nametbl 68 68 ;
Note: See TracChangeset
for help on using the changeset viewer.