Changeset 493 for trunk/SRC/Textoidl/strcnt.pro
- Timestamp:
- 04/08/14 11:28:29 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/Textoidl/strcnt.pro
r325 r493 7 7 ; 8 8 ; @param STRN {in}{required}{type=string} 9 ; The string in which to count occur ences.9 ; The string in which to count occurrences. 10 10 ; 11 11 ; @param SUBSTRN {in}{required}{type=string} … … 20 20 ; 21 21 ; @returns 22 ; Number of occur ances of substring in string.22 ; Number of occurrences of substring in string. 23 23 ; 24 24 ; @restrictions 25 ; Overlapping occur ances are not counted separately. For26 ; example, counting occur ances of 'bb' in 'blah bbb' returns one27 ; occur ance.25 ; Overlapping occurrences are not counted separately. For 26 ; example, counting occurrences of 'bb' in 'blah bbb' returns one 27 ; occurrence. 28 28 ; 29 29 ; @history … … 33 33 ; 34 34 ; Revision 1.2 1996/05/09 00:22:17 mcraig 35 ; Added fast processing using BYTE arrays if we are counting occur ences of36 ; a single character. Added error handling.35 ; Added fast processing using BYTE arrays if we are counting occurrences 36 ; of a single character. Added error handling. 37 37 ; 38 38 ; Revision 1.1 1996/01/31 18:47:37 mcraig … … 41 41 ; Copyright (C) 1996 The Regents of the University of California, All 42 42 ; Rights Reserved. Written by Matthew W. Craig. 43 ; See the file COPYRIGHT for restrictions on distr ubting this code.43 ; See the file COPYRIGHT for restrictions on distributing this code. 44 44 ; This code comes with absolutely NO warranty; see DISCLAIMER for details. 45 45 ; … … 62 62 print, offset+'num = strcnt(strn, substring, [pos])' 63 63 print, offset+'Inputs:' 64 print,offset+offset+'string -- The string in which to count occur ences. in'64 print,offset+offset+'string -- The string in which to count occurrences. in' 65 65 print,offset+offset+'substring -- The substring to count occurrences of. in' 66 66 print,offset+offset+'pos -- the position at which to begin the search. [in]' … … 70 70 print,offset+offset+'/HELP -- Print useful message and return.' 71 71 print, offset+'Outputs:' 72 print,offset+offset+'num -- Number of occur ances of substring in string. out'72 print,offset+offset+'num -- Number of occurrences of substring in string. out' 73 73 return, -1 74 74 ENDIF … … 78 78 ; return if we weren't really given a substring to search for. . . 79 79 IF strlen(substrn) EQ 0 THEN BEGIN 80 print, "Error: Can't count occur ances of null string."80 print, "Error: Can't count occurrences of null string." 81 81 return, -1 82 82 ENDIF … … 86 86 IF strlen(tmpstrn) EQ 0 THEN return, 0 87 87 88 ; If looking for occur ences of single character, process using BYTE88 ; If looking for occurrences of single character, process using BYTE 89 89 ; array. 90 90 IF strlen(substrn) EQ 1 THEN BEGIN
Note: See TracChangeset
for help on using the changeset viewer.