home *** CD-ROM | disk | FTP | other *** search
- {$M 8192,0,0}
-
- { RAOPP - RemoteAccess Offline Page Player version 1.0 }
- { Copyright (C) 1990 RodentWare, all rights reserved. }
- { Michael Reece/James Calvert * 1:3801/42 }
- { Based on original code by Dale Barnes }
-
- Program ROAPP;
-
- Uses
- GetWord,
- Exist,
- CRT,
- DOS;
-
- Const
- Version = '1.0';
-
- var
- PageFile : Text;
- PageFileName : String;
-
- PageLength : LongInt;
-
- ToneLn,
- WaitLn : integer;
- ToneS : integer;
-
- Tmp,
- TmpS : String;
-
- buffer : char;
-
- Function StUpCase(st:string):string;
- var x : byte;
- Begin
- StUpCase:=''; StUpCase[0]:=#0;
- StUpCase[0]:=St[0];
- for x:=1 to length(st) do StUpCase[x]:=UpCase(St[x]);
- end;
-
- Function Str2Word(st:string):integer;
- var x, z : integer;
- begin
- Val(St,X,Z);
- str2word:=x;
- end;
-
- Procedure PlayIt (PlayFile : String);
- Begin
- TmpS := '';
- Writeln ('Scanning '+StUpCase(PlayFile)+'...');
-
- Assign (PageFile, PlayFile);
- {$I-} Reset (PageFile); {$I+}
-
- while Not Eof (PageFile) Do
- Begin
- Readln (PageFile, TmpS);
- If TmpS[1] = ';' then ; { do nothing }
- TmpS := StUpCase (TmpS); { uppercase the string }
- no_space(tmps);
- Tmp := Get_Word(TmpS,1);
- If Tmp = 'TONE' then
- begin
- ToneS := Str2Word (Get_Word(Tmps, 2));
- ToneLn:= Str2Word (Get_Word(Tmps, 3));
- ToneLn := ToneLn * 10;
- PageLength:=PageLength+ToneLn;
- Sound (ToneS);
- Delay (ToneLn);
- If KeyPressed then
- Begin
- NoSound;
- buffer:=readkey; if keypressed then buffer:=readkey;
- {$I-} Close (PageFile); {$I+}
- Writeln;
- Writeln ('Aborted after ',Pagelength/1000:8:2,' seconds.');
- Halt;
- End;
- end;
- If Tmp = 'WAIT' then
- Begin
- WaitLn := Str2Word (Get_Word(TmpS, 2));
- WaitLn := WaitLn * 10;
- PageLength:=PageLength+WaitLn;
- Delay (WaitLn);
- End;
- NoSound;
- End;
- NoSound;
- Writeln;
- Writeln(Pagelength/1000:8:2,' seconds total.');
- {$I-} Reset (PageFile); {$I+}
- {$I-} Close (PageFile); {$I+}
- End;
-
- Procedure Stop (FileName : String);
- Begin
- Writeln ('Error: '+StUpCase(Filename)+' does not exist!');
- halt;
- End;
-
- Begin
- Assign (Input,'CON');
- Assign (Output,'CON');
- Rewrite (Input);
- Rewrite (Output);
- Writeln;
- Writeln ('RemoteAccess Offline Page Player v'+Version);
- Writeln ('Copyright (C) 1990 RodentWare, All rights reserved.');
- Writeln ('Michael Reece/James Calvert * 1:3801/42');
- Writeln;
- If ParamCount = 0 then
- Begin
- Writeln ('Usage: RAOPP <filename>');
- Halt;
- End;
-
- PageFileName := ParamStr(1);
-
- PageLength:=0;
-
- If FileExist (PageFileName) then
- PlayIt (PageFileName)
- Else
- Stop(PageFileName);
- end.
-