home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / SOUND / MISC / PLAYALL.ZIP / PLAYALL.PAS < prev   
Encoding:
Pascal/Delphi Source File  |  1991-06-30  |  2.0 KB  |  87 lines

  1.  {$M $2000,0,0 }   { 16K stack, no heap }
  2. Program play_all_Voc;
  3.  
  4.   uses Dos,crt;
  5.   var
  6.     DirInfo: SearchRec;
  7.     dirlist: array [1..1000] of string[12];
  8.     count,R: Word;
  9.     fname,programname, cmdline,drivepath,ext,progswitch:string[50];
  10.     fi:text;
  11.     reconfigflag:boolean;
  12.     x:integer;
  13.  
  14. Procedure Reconfigure;
  15. Begin
  16.   Writeln;
  17.   Writeln('           "Play All!!"  Setup');
  18.   Writeln;
  19.   Writeln;
  20.   Writeln('Enter the Drive\path\name of the player');
  21.   Write  ('         (EX:  C:\SOUND\VOX_KIT\VPLAY.EXE )  > ');
  22.   readln(programname);
  23.   writeln;
  24.   Writeln('Enter any command line switches for the player ');
  25.   Write  ('         (EX:  /Q )                          > ');
  26.   readln(progswitch);
  27.   writeln;
  28.   Rewrite(fi);
  29.   WriteLn(fi,programname);
  30.   writeln(fi,progswitch);
  31.   Close(fi);
  32. end;
  33.  
  34.  
  35. function ok_start:boolean;
  36.   var
  37.     ch:char;
  38.   begin
  39.     if ParamCount>=1 then
  40.       begin
  41.          ok_start:=false;
  42.          cmdline:=paramstr(1);
  43.          ch:=upcase(cmdline[1]);
  44.          if ch='R' then reconfigure
  45.                    else writeln('Use PLAYALL R to reconfigure ');
  46.  
  47.       end
  48.     else ok_start:=true;
  49.    {$I-}
  50.    Reset(fi);
  51.    readLn(fi,programname);
  52.    readln(fi,progswitch);
  53.    Close(fi);
  54.    {$I+}
  55.    if (IOResult <> 0) then
  56.      Begin
  57.        Writeln('Error Reading Configuration running setup!!');
  58.        reconfigure;
  59.      end;
  60.   end;
  61.  
  62.  
  63.   begin
  64.     fname:=paramstr(0);
  65.     count:=length(fname);
  66.     delete(fname,count-2,3);
  67.     fname:=fname+'CFG';
  68.     assign(fi,fname);
  69.  
  70.     if ok_start then
  71.     begin
  72.       Writeln(' "Play All!!" Ver 1.0 by Dennis Messer');
  73.       Writeln;
  74.       Writeln('Playing all VOC files in the directory.');
  75.           FindFirst('*.voc', Archive, DirInfo);
  76.             while ((DosError = 0) and (Not keypressed)) do
  77.              begin
  78.                cmdline:=dirinfo.name+' /Q';
  79.                SwapVectors;
  80.                Exec(programname,cmdline);
  81.                SwapVectors;
  82.                FindNext(DirInfo);
  83.              end;
  84.     end;
  85.  End.
  86.  
  87.