Changeset 192 for trunk/SRC/Obsolete
- Timestamp:
- 09/22/06 11:37:08 (18 years ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/Obsolete/strrepl.pro
r191 r192 4 4 ; @file_comments 5 5 ; replace one (or more) character(s)/string(s) in a string 6 ; --- OBSOLETE --- you should better use strsed.pro 6 7 ; 7 8 ; @categories … … 10 11 ; @param STR {in}{required} 11 12 ; the string to be changed 13 ; 14 ; @param ARG2 {in}{required} 15 ; position of the character(s) to be replaced or a string to be changed in STR. 12 16 ; 13 17 ; @param RCHAR {in}{required} … … 63 67 64 68 65 function strrepl,str,a gument1,rchar69 function strrepl,str,arg2,rchar 66 70 ; 67 compile_opt idl2, strictarrsubs 71 compile_opt idl2, strictarrsubs, obsolete 68 72 ; 69 73 … … 73 77 BStr = byte(str) 74 78 new = byte(rchar) 75 if size(a gument1, /type) EQ 7 then begin76 old = byte(a gument1)77 index = strpos(str, a gument1)79 if size(arg2, /type) EQ 7 then begin 80 old = byte(arg2) 81 index = strpos(str, arg2) 78 82 pos = index 79 while strpos(str, a gument1, pos+1) NE -1 do BEGIN80 pos = strpos(str, a gument1, pos+1)83 while strpos(str, arg2, pos+1) NE -1 do BEGIN 84 pos = strpos(str, arg2, pos+1) 81 85 index = [index, pos] 82 86 ENDWHILE … … 84 88 if (index[0] lt 0 OR index[0] ge n_elements(BStr)) THEN return,Str 85 89 ENDIF ELSE BEGIN 86 index = a gument190 index = arg2 87 91 if (index[0] lt 0 OR index[0] ge n_elements(BStr)) then return,Str 88 92 old = BStr[index[0]]
Note: See TracChangeset
for help on using the changeset viewer.