home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mega A/V
/
mega_av.zip
/
mega_av
/
SOUNDUTL
/
QUOTEME.ZIP
/
QUOTEME.PAS
< prev
Wrap
Pascal/Delphi Source File
|
1991-04-04
|
3KB
|
114 lines
{$M $2000,0,0 } { 16K stack, no heap }
Program play_cookie;
uses Dos;
var
DirInfo: SearchRec;
dirlist: array [1..1000] of string[12];
count,R: Word;
fname,programname, cmdline,drivepath,ext,progswitch:string[50];
fi:text;
reconfigflag:boolean;
x:integer;
Procedure Reconfigure;
Begin
Writeln;
Writeln(' "Don''T quote me!!" Setup');
Writeln;
Writeln;
Writeln('Enter the Drive\path\name of the player');
Write (' (EX: C:\SOUND\VOX_KIT\VPLAY.EXE ) > ');
readln(programname);
writeln;
Writeln('Enter any command line switches for the player ');
Write (' (EX: /Q ) > ');
readln(progswitch);
Writeln;
Writeln('Enter the Drive\path\ of the sound files to play');
Write (' (EX: C:\SOUND\SOUNDS\ ) > ');
readln(DRIVEPATH);
writeln;
Writeln('Enter the filter for the files to be played ');
Write (' (EX: *.VOC ) > ');
readln(ext);
writeln;
Rewrite(fi);
WriteLn(fi,programname);
writeln(fi,drivepath);
writeln(fi,ext);
writeln(fi,progswitch);
Close(fi);
end;
function ok_start:boolean;
var
ch:char;
begin
if ParamCount>=1 then
begin
ok_start:=false;
cmdline:=paramstr(1);
ch:=upcase(cmdline[1]);
if ch='R' then reconfigure
else writeln('Use QUOTEME R to reconfigure ');
end
else ok_start:=true;
{$I-}
Reset(fi);
readLn(fi,programname);
readln(fi,drivepath);
readln(fi,ext);
readln(fi,progswitch);
Close(fi);
{$I+}
if (IOResult <> 0) then
Begin
Writeln('Error Reading Configuration running setup!!');
reconfigure;
end;
end;
begin
Writeln(' "Don''t Quote Me!!" Ver 1.1 random sound player by Dennis Messer');
Writeln;
fname:=paramstr(0);
count:=length(fname);
delete(fname,count-2,3);
fname:=fname+'CFG';
assign(fi,fname);
reconfigflag:=false;
if ok_start then
Begin
randomize;
count:=1;
FindFirst(drivepath+ext, Archive, DirInfo);
if (doserror<>0) then reconfigflag:=true;
if not reconfigflag then
begin
while ((DosError = 0) and (count<=1000)) do
begin
dirlist[count]:=dirinfo.name;
{ writeln(dirinfo.name);}
count:=count+1;
FindNext(DirInfo);
end;
if count>1 then
begin
R:=random(count-1)+1;
cmdline:=drivepath+dirlist[r]+' '+progswitch;
SwapVectors;
Exec(ProgramName, CmdLine);
SwapVectors;
end;
end;
end;
if reconfigflag then reconfigure;
End.