home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / sd386v50.zip / sd386src.zip / SHOWDF.C < prev    next >
Text File  |  1995-12-01  |  6KB  |  78 lines

  1. /*****************************************************************************/
  2. /* File:                                             IBM INTERNAL USE ONLY   */
  3. /*   showdf.c                                                                */
  4. /*                                                                           */
  5. /* Description:                                                              */
  6. /*   Data File Display Formatting Routines                                   */
  7. /*                                                                           */
  8. /*                                                                           */
  9. /* History:                                                                  */
  10. /*                                                                           */
  11. /*   02/08/91 Creation of 32-bit SD86, from 16-bit version.                  */
  12. /*                                                                           */
  13. /*...16->32 port.                                                            */
  14. /*...                                                                        */
  15. /*... 02/08/91  101   Joe       port to 32 bit.                              */
  16. /*...                                                                        */
  17. /*...Release 1.01 (04/03/92)                                                 */
  18. /*...                                                                        */
  19. /*... 05/08/92  701   Srinivas  Cua Interface.                               */
  20. /**Includes*******************************************************************/
  21.  
  22. #include "all.h"                        /* SD86 include files                */
  23.  
  24. /**External declararions******************************************************/
  25.  
  26. extern uint        VideoCols;           /*  number of screen columns.        */
  27. extern uint        DataFileTop;         /* top record displayed in data file.*/
  28. extern uint        VioStartOffSet;      /* flag to tell were to start screen */
  29.                                         /* display.                       701*/
  30.  
  31. /*****************************************************************************/
  32. /*  fmtdwinstat()                                                            */
  33. /*                                                                           */
  34. /* Description:                                                              */
  35. /*   Format the data window status line.                                     */
  36. /*                                                                           */
  37. /* Parameters:                                                               */
  38. /*                                                                           */
  39. /* Return:                                                                   */
  40. /*   void                                                                    */
  41. /*                                                                           */
  42. /* Assumptions:                                                              */
  43. /*                                                                           */
  44. /*****************************************************************************/
  45. #define MAXFLDSIZE 8                    /* Size of "line xxxx of xxxx" field.*/
  46.  void                                   /*                                   */
  47. fmtdwinstat(uint dstatrow,int row)      /* dstatrow : data window status row */
  48.                                         /* row:current record no in data file*/
  49. {                                       /*                                   */
  50.  uint  n;                               /* # of chars formatted(field size). */
  51.  uchar buffer[ MAXFLDSIZE+4 ];          /*                                   */
  52.  char  format[15];                      /* format for status line.           */
  53.  int   recno;                           /* record # the cursor is on.        */
  54.                                         /*                                   */
  55. /*****************************************************************************/
  56. /* First, clear the status line and turn on its color.                       */
  57. /*****************************************************************************/
  58.  ClrScr( dstatrow, dstatrow, vaStgStat);/*                                   */
  59.                                         /*                                   */
  60. /*****************************************************************************/
  61. /* Format the "rec xxxx " field of the status line.                          */
  62. /*                                                                           */
  63. /*****************************************************************************/
  64.  recno = DataFileTop + row + 1 - VioStartOffSet;                        /*701*/
  65.  strcpy(format,"%crec %d");             /* Use this base format.             */
  66.  n = sprintf( buffer,                   /*                                521*/
  67.              format,                    /* Use this format                   */
  68.              Attrib(vaStgStat),         /* and this attribute.               */
  69.              recno                      /* The file record #. (1...N).       */
  70.            );                           /*                                   */
  71.  memset(buffer+n,' ',MAXFLDSIZE+1-n );  /* Pad end of buffer with blanks. 101*/
  72.  buffer[ MAXFLDSIZE+1 ] = 0;            /* terminate the string.             */
  73.  putrc( dstatrow,                       /* display the string.               */
  74.         VideoCols-MAXFLDSIZE,
  75.         buffer                          /*                                   */
  76.       );                                /*                                   */
  77. }
  78.