Changeset 374
- Timestamp:
- 08/08/08 17:12:27 (16 years ago)
- Location:
- trunk/SRC/ToBeReviewed/STRING
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/ToBeReviewed/STRING/getfile.pro
r372 r374 8 8 ; 9 9 ; @keyword ERROR 10 ; =err error flag: 0=ok, 1=file not opened, 11 ; 2=no lines in file. 10 ; error flag: 0=ok, 1=file not opened, 2=no lines in file. 12 11 ; 13 12 ; @keyword QUIET … … 15 14 ; 16 15 ; @keyword LINES 17 ; =nNumber of lines to read (def=all).16 ; Number of lines to read (def=all). 18 17 ; Much faster if number of lines is known. 19 18 ; Automatic for IDL 5.6 or later. 20 19 ; 21 20 ; @keyword FIND 22 ; search the file in the all !path directories (use 23 ; find.pro) 21 ; search the file in the all !path directories (use <pro>find</pro>) 24 22 ; 25 23 ; @keyword HELP -
trunk/SRC/ToBeReviewed/STRING/getwrd.pro
r372 r374 44 44 ; given is used. This saves finding the words again. 45 45 ; If m > n wrd will be a string of words from word n to 46 ; word m. 46 ; word m. If no m is given wrd will be a single word. 47 47 ; n<0 returns text starting at word abs(n) to string end 48 48 ; If n is out of range then a null string is returned. 49 ; See also nwrds.49 ; See also <pro>nwrds</pro>. 50 50 ; 51 51 ; @history -
trunk/SRC/ToBeReviewed/STRING/putfile.pro
r372 r374 7 7 ; 8 8 ; @param FILE {in}{required}{type=string} 9 ; =text file name.9 ; text file name. 10 10 ; 11 11 ; @param S {in}{required}{type=string or array} 12 ; =string array.12 ; string array. 13 13 ; 14 14 ; @keyword ERROR 15 ; =errerror flag: 0=ok, 1=invalid string array.15 ; error flag: 0=ok, 1=invalid string array. 16 16 ; 17 17 ; @history -
trunk/SRC/ToBeReviewed/STRING/string2struct.pro
r372 r374 39 39 ; 40 40 ; @param STRVAL {IN}{REQUIRED} 41 ; String set up as keywords. Keywords require a little special treatment. Such as 42 ; plot,findgen(100),_extra=stringToStructure('title="testing"') 41 ; String set up as keywords. Keywords require a little special treatment. 42 ; Such as 43 ; 44 ; plot,findgen(100),_extra=string2struct('title="testing"') 43 45 ; 44 46 ; @returns … … 50 52 ; pro tPlot,event 51 53 ; widget_control,event.top,get_uvalue=field 52 ; widget_control,field,get_value=str Val53 ; extra = string ToStructure(strVal)54 ; widget_control,field,get_value=strval 55 ; extra = string2struct(strval) 54 56 ; plot,findgen(100),_extra=extra 55 57 ; wshow … … 78 80 ; 79 81 ;- 80 FUNCTION string2struct,str Val82 FUNCTION string2struct,strval 81 83 ; 82 84 compile_opt idl2, strictarrsubs 83 85 ; 84 r = execute('extra = too_cool(' + str Val[0] +')')86 r = execute('extra = too_cool(' + strval[0] +')') 85 87 ;if r = 0 then user did not enter keywords correctly so 86 88 ;return a structure with a null field. … … 91 93 return,extra 92 94 end 93 -
trunk/SRC/ToBeReviewed/STRING/strright.pro
r325 r374 12 12 ; @param LASTN {in}{required}{default=1} 13 13 ; the number of characters to be returned. 14 ; If NLAST is the strlen(STRING), the complete string 14 ; 15 ; If LASTN is the strlen(STRING), the complete string 15 16 ; is returned. 16 17 ; … … 19 20 ; 20 21 ; @examples 21 ; if (strright(path) ne '/') then path = path + '/' 22 ; 23 ; add a "/" in to path if it "/" is not at the end : 24 ; 25 ; IDL> path="/tmp" 26 ; IDL> if (strright(path) ne '/') then path = path + '/' 27 ; IDL> print,path 28 ; /tmp/ 22 29 ; 23 30 ; @history -
trunk/SRC/ToBeReviewed/STRING/strsci.pro
r372 r374 3 3 ; @file_comments 4 4 ; Given a number, returns a string of that B 5 ; number in scientific notation format ( e.g. A x 10 5 ; number in scientific notation format ( e.g. A x 10^B ) 6 6 ; 7 7 ; @categories -
trunk/SRC/ToBeReviewed/STRING/strtok.pro
r372 r374 33 33 ; were set, old would be 'bar' on return. 34 34 ; 35 ; not ok ++ 36 ; IDL> old='foo44 bar' 37 ; IDL> res=strtok( old, '44' ) 38 ; IDL> print,res 39 ; 0 5 40 ; IDL> print,old 41 ; foo44 bar 42 ; 43 ; IDL> old='foo44 bar' 44 ; IDL> res=strtok( old, '44',/TRIM ) 45 ; IDL> print,res 46 ; 0 5 47 ; IDL> print,old 48 ; foo44 bar 49 ; 50 ; not ok ++ 35 51 ; If old='xyz', then new=strtok(old,'a') would return with 36 52 ; new='xyz' and old=''. 53 ; IDL> old='xyz' 54 ; IDL> new=strtok( old, 'a' ) 55 ; IDL> print,new 56 ; 0 57 ; IDL> print,old 58 ; xyz 59 37 60 ; 38 61 ; @history … … 116 139 117 140 END 118
Note: See TracChangeset
for help on using the changeset viewer.