home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Programmer's Library 1.3 / Microsoft-Programers-Library-v1.3.iso / sampcode / prof_c / 05oslib / bios / writestr.c < prev    next >
Encoding:
C/C++ Source or Header  |  1988-08-11  |  470 b   |  25 lines

  1. /*
  2.  *    writestr -- write a string in
  3.  *    the prevailing video attribute
  4.  */
  5.  
  6. #include <local\std.h>
  7.  
  8. int
  9. writestr(s, pg)
  10. register char *s;    /* string to write */
  11. unsigned int pg;    /* screen page for writes */
  12. {
  13.     unsigned int r, c, c0;
  14.  
  15.     readcur(&r, &c, pg);
  16.     for (c0 = c; *s != '\0'; ++s, ++c) {
  17.         putcur(r, c, pg);
  18.         writec(*s, 1, pg);
  19.     }
  20.  
  21.     /* restore cursor position and return # of characters displayed */
  22.     putcur(r, c0, pg);
  23.     return (c - c0);
  24. }
  25.