home *** CD-ROM | disk | FTP | other *** search
-
- /****************************************************
- *
- * STRREP -- replace a char in a string
- * strrep (str, pos, ch) is the same as the C line
- * str [pos]=ch ;
- * except that Clipper numbers arrays from 1, not 0.
- *
- * In order for this to link properly, you need to
- * compile with the -N- switch. This prevents
- * Turbo C from checking thhe stack for overflow:
- * tcc -c -N- -ml strrep
- *
- *****************************************************
-
- #include <nandef.h>
- #include <extend.h>
-
- CLIPPER strrep (void)
- {
- char *str = _parc (1) ;
- int pos = _parni(2) ;
- char *rep = _parc (3) ;
-
- str[pos-1] = *rep ;
- _ret() ;
- }