Changeset 223 for trunk/SRC/Utilities
- Timestamp:
- 03/14/07 18:13:39 (17 years ago)
- Location:
- trunk/SRC/Utilities
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/Utilities/protype.pro
r163 r223 6 6 ; test is a ".pro" file corresponds to an IDL procedure, function or batch file. 7 7 ; 8 ; @categories 8 ; @categories 9 9 ; Utilities 10 10 ; 11 ; @param FILE {in} 12 ; A scalar of string type, the name of the ".pro" file to be tested11 ; @param FILE {in}{required}{type=string} 12 ; the name of the ".pro" file to be tested. 13 13 ; if necessary, the input name is completed with '.pro' 14 14 ; and its path found in !path 15 15 ; 16 ; @returns 16 ; @returns 17 ; -1 if not found 17 18 ; A scalar of string type: 'proc', 'func' or 'batch' 18 19 ; … … 54 55 ELSE:RETURN, 'batch' 55 56 ENDCASE 56 57 57 58 RETURN, -1 58 59 END -
trunk/SRC/Utilities/xfile.pro
r163 r223 4 4 ;+ 5 5 ; 6 ; @file_comments 6 ; @file_comments 7 7 ; display in a widget an ASCII file. 8 ; It is the same thing that xdisplayfile but here, we use it 9 ; to display the content of a procedure or of a function, 8 ; It is the same thing that xdisplayfile but here, we use it 9 ; to display the content of a procedure or of a function, 10 10 ; even if it is not in the current directory (thanks to the path). 11 11 ; 12 ; @categories 12 ; @categories 13 13 ; Utilities 14 14 ; 15 ; @param FILENAME {in}{required} 16 ; It is the name of the procedure or of the function 15 ; @param FILENAME {in}{required} 16 ; It is the name of the procedure or of the function 17 17 ; we want to display (with or without .pro at the end). 18 18 ; 19 ; @keyword _EXTRA 19 ; @keyword _EXTRA 20 20 ; used to pass your keywords 21 21 ; 22 ; @examples xfile,'plt' 22 ; @examples 23 ; IDL> xfile,'plt' 23 24 ; 24 ; @history Sebastien Masson (smasson\@lodyc.jussieu.fr) 25 ; 7/1/99 26 ; 6/7/1999: compatibility mac and windows 25 ; @history 26 ; Sebastien Masson (smasson\@lodyc.jussieu.fr) 27 ; 7/1/99 28 ; 6/7/1999: compatibility mac and windows 27 29 ; 28 ; @version $Id$ 30 ; @version 31 ; $Id$ 29 32 ; 30 33 ;- … … 38 41 pfile = strlowcase(filename) 39 42 ; 40 ; we have to find the full name. 43 ; we have to find the full name. 41 44 ; 42 if strpos(pfile,".pro") lt 0 then pfile=pfile+".pro" 45 if strpos(pfile,".pro") lt 0 then pfile=pfile+".pro" 43 46 thisOS = strupcase(strmid(!version.os_family, 0, 3)) 44 47 CASE thisOS of … … 56 59 i = 0 57 60 repeat begin 58 res = findfile(pfile[i]) 61 res = findfile(pfile[i]) 59 62 i = i+1 60 endrep until res[0] NE '' OR i EQ n_elements(pfile) 63 endrep until res[0] NE '' OR i EQ n_elements(pfile) 61 64 if res[0] NE '' then BEGIN 62 65 ; we open the file in a widget 63 66 xdisplayfile, pfile[i-1], _extra = ex 64 ENDIF ELSE ras = report(' le fichier demande n''existe pas...')67 ENDIF ELSE ras = report('file does not exist ...') 65 68 ; 66 69 ; -
trunk/SRC/Utilities/xhelp.pro
r163 r223 1 1 ;+ 2 2 ; 3 ; @file_comments 3 ; @file_comments 4 4 ; Display an IDL procedure header using widgets and the widget manager. 5 5 ; … … 7 7 ; Widget 8 8 ; 9 ; @param FILENAME {in}{required} 10 ; A scalar string that contains the filename of the file to display. 11 ; If FILENAME does not include a complete path specification, xhelp will 9 ; @param FILENAME {in}{required} 10 ; A scalar string that contains the filename of the file to display. 11 ; If FILENAME does not include a complete path specification, xhelp will 12 12 ; search for the file in the current working directory and then each of the 13 13 ; directories listed in !PATH environment variable. The 14 14 ; ".pro" file suffix will be appended if it is not supplied. 15 15 ; 16 ; @keyword _EXTRA 16 ; @keyword _EXTRA 17 17 ; used to pass your keywords 18 18 ; 19 ; @restrictions 19 ; @restrictions 20 20 ; Triggers the XMANAGER if it is not already in use. 21 21 ; 22 ; @examples 23 ; Open a file and create a widget to display its contents.22 ; @examples 23 ; IDL> xhelp,'plt' 24 24 ; 25 ; @history Written By Steve Richards, December 1990 25 ; @history 26 ; Written By Steve Richards, December 1990 26 27 ; Graceful error recovery, DMS, Feb, 1992. 27 28 ; Modified to extract .pro documentation headers, PJR/ESRG mar94 … … 33 34 ; 6/7/1999: compatibility mac and windows 34 35 ; 35 ; @version $Id$ 36 ; @version 37 ; $Id$ 36 38 ; 37 39 ;- … … 47 49 return 48 50 endif 49 ; We have to find the full name 51 ; We have to find the full name 50 52 pfile=FILENAME 51 if strpos(pfile,".pro") lt 0 then pfile=pfile+".pro" 53 if strpos(pfile,".pro") lt 0 then pfile=pfile+".pro" 52 54 thisOS = strupcase(strmid(!version.os_family, 0, 3)) 53 55 CASE thisOS of … … 67 69 n = 0 68 70 repeat begin 69 res = findfile(pfile[n]) 71 res = findfile(pfile[n]) 70 72 n = n+1 71 endrep until res[0] NE '' OR n EQ n_elements(pfile) 73 endrep until res[0] NE '' OR n EQ n_elements(pfile) 72 74 if res[0] NE '' then BEGIN 73 75 openr, unit,pfile[n-1], /get_lun ; opening of the file 74 ; we select the heading piece 76 ; we select the heading piece 75 77 a = strarr(1000) ;Maximum # of lines 76 78 xsize=0 … … 90 92 endwhile 91 93 if i EQ 0 then $ 92 ras = report('le programme a etait mal ecrit, il n''y a pas d''en-tete... utiliser xfile.pro.') ELSE BEGIN 94 ras = report('le programme a etait mal ecrit, il n''y a pas d''en-tete... utiliser xfile.pro.') ELSE BEGIN 93 95 a = a[0:i-1] 94 96 ; we wrote the a's content in a widget 95 97 xdisplayfile,'toto',text = a,title=pfile[n-1], _extra = ex 96 ENDELSE 98 ENDELSE 97 99 FREE_LUN, unit ;free the file unit. 98 100 ENDIF ELSE ras = report('le fichier demande n''existe pas...')
Note: See TracChangeset
for help on using the changeset viewer.