home *** CD-ROM | disk | FTP | other *** search
- 1: (* ----------------------------------------------------- *)
- 2: (* PLAYDEMO.PAS *)
- 3: (* Einfacher Editor zur Demonststration der Unit MUSIC *)
- 4: (* (c) 1989 Alexander Sunder *)
- 5: (* ----------------------------------------------------- *)
- 6: PROGRAM Play_Demonstration;
- 7: USES Crt,Music;
- 8: VAR E : ARRAY[1..5,1..80] OF CHAR;
- 9: Noten : STRING;
- 10: X,Y,i,j : BYTE;
- 11: Ch : CHAR;
- 12: Leer : BOOLEAN;
- 13: BEGIN
- 14: ClrScr;GotoXY(1,6);TextColor(0);TextBackGround(7);
- 15: write('Pfeiltasten:Cursor bewegen <-:löschen',
- 16: ' Del:Alles löschen Enter:Abspielen');
- 17: TextColor(8);TextBackGround(1); X:=1;Y:=1;
- 18: FOR i:=1 TO 5 DO FOR j:=1 TO 80 DO E[i,j]:=' ';
- 19: REPEAT
- 20: GotoXY(X,Y); Ch:=ReadKey;
- 21: IF Ch IN [#0,#13,#8] THEN BEGIN
- 22: IF Ch=#0 THEN Ch:=ReadKey;CASE Ch OF
- 23: #72:IF Y>1 THEN dec(y) ELSE Y:=5;
- 24: #80:IF Y<5 THEN inc(Y) ELSE Y:=1;
- 25: #75:IF X>1 THEN dec(x) ELSE X:=80;
- 26: #77:IF X<80 THEN inc(X) ELSE X:=1;
- 27: #83:BEGIN window(1,1,80,5);ClrScr;window(1,1,80,25);
- 28: FOR i:=1 TO 5 DO FOR j:=1 TO 80 DO E[i,j]:=' ';
- 29: END;
- 30: #8 :BEGIN
- 31: IF X=1 THEN IF Y=1 THEN BEGIN Y:=5;X:=80 END
- 32: ELSE BEGIN X:=80;Dec(Y) END ELSE dec(X);
- 33: GotoXY(X,Y);write(' ');E[Y,X]:=' ' END;
- 34: #13:FOR i:=1 TO 5 DO BEGIN
- 35: Leer:=true;Noten:='';
- 36: FOR j:=1 TO 80 DO BEGIN Noten:=Noten+E[i,j];
- 37: IF E[i,j]<>' ' THEN Leer:=false END;
- 38: IF NOT(Leer) THEN Play(Noten)
- 39: END END END
- 40: ELSE IF Ch<>#27 THEN BEGIN
- 41: GotoXY(X,Y);write(Ch); E[Y,X]:=Ch;
- 42: IF X=80 THEN BEGIN X:=1;IF Y<5 THEN inc(Y) END
- 43: ELSE inc(X) END
- 44: UNTIL Ch=#27;
- 45: TextColor(7);TextBackGround(0);GotoXY(1,7)
- 46: END.
- 47: (* ----------------------------------------------------- *)
- 48: (* Ende von PLAYDEMO.PAS *)
-