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

  1. /*
  2.  *    curback -- move cursor back (left); return the
  3.  *    value of the new column position
  4.  */
  5.  
  6. #include <local\bioslib.h>
  7.  
  8. int
  9. curback(n, pg)
  10. int n, pg;
  11. {
  12.     int r, c;
  13.  
  14.     /*
  15.      *    move the cursor left by up to n positions but 
  16.      *    not past the beginning of the current line
  17.      */
  18.     readcur(&r, &c, pg);
  19.     if (c - n < 0)
  20.         c = 0;
  21.     putcur(r, c, pg);
  22.     return (c);
  23. }
  24.