home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a012 / 1.ddi / CHAP20.EXE / CHP2006.PRG < prev    next >
Encoding:
Text File  |  1991-04-30  |  477 b   |  18 lines

  1. /*
  2.    Listing 20.6  Occurs()
  3.    Author: Joe Booth
  4.    Excerpted from "Clipper 5: A Developer's Guide"
  5.    Copyright (c) 1991 M&T Books
  6.                       501 Galveston Drive
  7.                       Redwood City, CA 94063-4728
  8.                       (415) 366-3600
  9. */
  10.  
  11. //───── NOTE: must compile with the /N option!
  12.  
  13. function occurs(cChar,cString)
  14. LOCAL x := len(cString), y := len(strtran(cString,cChar,""))
  15. return (x-y) / len(cChar)
  16.  
  17. // end of file CHP2006.PRG
  18.