home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-386-Vol-2of3.iso / h / hslkslt2.zip / HSLKSALT.SLT < prev    next >
Text File  |  1992-01-06  |  3KB  |  144 lines

  1. // Telix SALT script by Dave Whittaker
  2. // 6 NOV 91
  3. // Revised 06 JAN 92 by Paul Gardner
  4. // Changed recusion to while loops
  5. //
  6. // Used to run HS/Link Bi-Directional protocol from Telix.
  7. // Menu allows online creation or deletion of upload list.
  8. // Also has option for starting the protocol from a menu.
  9.  
  10.  
  11. int f;                  str listloc[] = "d:\list.txt";
  12. int v;
  13. int select;             str proto[] = "c:\telix\hslink.exe";
  14. int q;                  str comline_opt[] = "-Uc:\zip @d:\list.txt";
  15.  
  16. str data[64];
  17.  
  18. main()
  19. {
  20. _fore_color = 14;
  21. _back_color = 1;
  22.  
  23. select = 0;
  24. v=(vsavearea(0,10,79,23));
  25.  
  26. while (select == 0)
  27.   {
  28.    menu();
  29.   }
  30. restore();
  31. return();
  32. }
  33.  
  34. // --------------------- END MAIN ---------------------------------------
  35.  
  36.  
  37. //
  38. //                   FUNCTIONS CALLED FROM MAIN:
  39. //
  40.  
  41.  
  42. // BOXER
  43. // Makes a clean half screen blue box.
  44.  
  45. boxer()
  46. {
  47. box(0,10,79,23,0,0,17);
  48. }
  49.  
  50.  
  51.  
  52. // LISTING
  53. // Makes list of files to upload.
  54.  
  55. listing()
  56.   {
  57.    q = 'y';
  58.    while (q=="Y" || q=="y")
  59.      {
  60.       boxer();
  61.       f=fopen(listloc,"a+");
  62.  
  63.       pstraxy("              Prepare Uploads List",1,10,30);
  64.       pstraxy("Enter full path and filename now...",1,13,30);
  65.       gotoxy(1,14);
  66.       gets(data,64);
  67.  
  68.       pstraxy("Writing to LIST.TXT now.",1,15,30);
  69.       fseek(f,0,2);
  70.       fputs(data,f);
  71.       fputs("^M^J",f);
  72.       fclose(f);
  73.       pstraxy("Hit 'Y' for another; or any other key to quit.",1,17,30);
  74.       q=inkeyw();
  75.      }
  76.   }
  77.  
  78.  
  79.  
  80. // MENU
  81. // Prints a menu in the box to select the list option or start the
  82. // protocol.
  83.  
  84. menu()
  85. {
  86. boxer();
  87.  
  88. pstraxy("                         HS/Link Transfer Menu",1,10,16);
  89. pstraxy("                         Select an Option:",1,13,20);
  90. pstraxy(" 1.             Start Transfer Immediately",1,15,30);
  91. pstraxy(" 2.             Prepare Uploads List",1,17,30);
  92. pstraxy(" 3.             Delete Uploads List",1,19,30);
  93. pstraxy(" 4.             Return to Telix Terminal Mode",1,21,30);
  94.  
  95. select = inkeyw();
  96.  
  97.         if (select == "1")
  98.                 {
  99.                  linkup();
  100.                  select = 9;
  101.                 }
  102.         if (select == "2")
  103.                 {
  104.                  listing();
  105.                  select = 0;
  106.                 }
  107.         if (select == "3")
  108.                 {
  109.                  dos("del d:\list.txt",0);
  110.                  select = 0;
  111.                 }
  112.         if (select == "4")
  113.                 {
  114.                  select = 9;
  115.                 }
  116.         else
  117.         {
  118.          select = 0;
  119.         }
  120. }
  121.  
  122.  
  123. // LINKUP
  124. // Starts the transfer using HS/Link protocol.
  125.  
  126. linkup()
  127. {
  128. run(proto,comline_opt,0);
  129. restore();
  130. }
  131.  
  132.  
  133.  
  134.  
  135. // restore
  136. // Restores screen and exits the script.
  137.  
  138. restore()
  139. {
  140. vrstrarea(v);
  141. }
  142.  
  143.  
  144.