home *** CD-ROM | disk | FTP | other *** search
/ Black Box 4 / BlackBox.cdr / progc / cfuncs.arj / JULIAN.C < prev    next >
Encoding:
C/C++ Source or Header  |  1991-06-03  |  1.2 KB  |  62 lines

  1. #include <conio.h>
  2. #include <inout.h>
  3.  
  4. void DispScr(void)
  5. {
  6.    clrscr();
  7.    WriteAt(17, 18, LIGHTGRAY, BLACK, "F2 - Change Modes  ESC - Exit");
  8. }
  9. void main(void)
  10. {
  11.   char dte[30] = "mm/dd/yy";
  12.   unsigned int julian;
  13.   int ret, mode = ENTER, DateType=0;
  14.   long lngdate;
  15.  
  16.   DispScr();
  17.  
  18.   do {
  19.  
  20.      if(DateType==0)
  21.      {
  22.  
  23.        inout(20, 16, 8, LIGHTGRAY, BLACK, dte, mode, DATE, DOTS, "FXX", &ret);
  24.        if(ret ==F2)
  25.        {
  26.       DateType=1;
  27.       mode=ENTER;
  28.       DispScr();
  29.        }
  30.  
  31.        if(ret!=0 && ret!=ENTER_KEY)
  32.       continue;
  33.  
  34.        if(ConvertDate(&julian, dte, 0, 6))
  35.        continue;
  36.        WriteAt(40, 16, LIGHTGRAY, BLACK, "%-6u", julian);
  37.        mode = EDIT_BEG;
  38.      }
  39.      else
  40.      {
  41.        inout(20, 16, 5, LIGHTGRAY, BLACK, &lngdate, mode, LONG, DOTS, "FXX", &ret);
  42.        if(ret ==F2)
  43.        {
  44.       DateType=0;
  45.       DispScr();
  46.       mode=ENTER;
  47.        }
  48.  
  49.        if(ret!=0 && ret!=ENTER_KEY)
  50.       continue;
  51.  
  52.        julian = lngdate;
  53.        if(ConvertDate(dte, &julian, 2, 0))
  54.        continue;
  55.  
  56.        WriteAt(40, 16, LIGHTGRAY, BLACK, "%-30s",dte);
  57.        mode = EDIT_BEG;
  58.      }
  59.   } while(ret != ESC);
  60.   gotoxy(1,19);
  61.  
  62. }