home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS 1992 September / Simtel20_Sept92.cdr / msdos / telix / tset31.arc / TIMECFG.SLT < prev    next >
Text File  |  1988-10-31  |  2KB  |  74 lines

  1. main()
  2. {
  3.     int cfg,
  4.     n;
  5.     str str_ent[25],
  6.     dial_str[25]="1-202-653-0351",
  7.     time_adj_str[3]="6",
  8.     script_path[78];
  9.  
  10.     copystr(_script_dir,script_path,0,65);
  11.     strcat(script_path,"timeset.cfg");
  12.  
  13.     cfg=fopen(script_path,"r");
  14.     if(cfg)
  15.     {
  16.     fgets(dial_str,25,cfg);
  17.     fgets(time_adj_str,2,cfg);
  18.     }
  19.     fclose(cfg);
  20.  
  21.     cfg=fopen(script_path,"w+");
  22.     while(1)
  23.     {
  24.     clear_scr();
  25.     prints("Timeset configuration routine!");
  26.     prints(" ");
  27.     prints("Initial values:");
  28.     prints("    Dial String:      1-202-653-0351");
  29.     prints("    Time Adjustment:  6");
  30.     prints(" ");
  31.     prints("These are the current values:");
  32.     printsc("A.  Dialing String:  ");
  33.     prints(dial_str);
  34.     printsc("B.  Time adjustment value:  ");
  35.     prints(time_adj_str);
  36.     prints(" ");
  37.     prints("Which do you want to change? <C=No changes desired!>");
  38.     prints(" ");
  39.     _scr_chk_key=1;
  40.     n=inkeyw();
  41.     if(n=="A"|n=="a")
  42.     {
  43.         printsc("The current dialing string is:  ");
  44.         prints(dial_str);
  45.         prints("Change it to?  <Esc aborts entry!>");
  46.         if(gets(str_ent,25)!=-1)
  47.         {
  48.         copystr(str_ent,dial_str,0,20);
  49.         }
  50.     }
  51.     if(n=="B"|n=="b")
  52.     {
  53.         printsc("The current time adjustment value is:  ");
  54.         prints(time_adj_str);;
  55.         prints("Change it to?  <Esc aborts entry!>");
  56.         if(gets(str_ent,3)!=-1)
  57.         {
  58.         copystr(str_ent,time_adj_str,0,2);
  59.         }
  60.     }
  61.     if(n=="C"|n=="c")
  62.     {
  63.         fputs(dial_str,cfg);
  64.         fputc(0x0a,cfg);
  65.         fputs(time_adj_str,cfg);
  66.         fputc(0x0a,cfg);
  67.         fclose(cfg);
  68.         clear_scr();
  69.         prints("Timeset configuration file created!");
  70.         return;
  71.     }
  72.     }
  73. }
  74.