07/10/11 13:33
Loryea
Salve, ho fatto un riproduttore di note musicali con pascal, ma l'IDE mi risponde con un errore. Ecco il codice:
Ecco l'errore:
music.pas(28,2) fatal: Syntax error, ";" expected but "UNTIL" found.
Sembra un errore semplice, ma non riesco a trovare il punto dove ho dimenticato il ";". La linea 28, é quella dove ho usato il primo "UNTIL".
Program Music; Uses crt; Var A,B,Hz,Durata:integer; C:Char; Begin Repeat Repeat Repeat clrscr; Writeln('Scegli cosa fare'); Writeln; Writeln('[1] Traduttore note'); Writeln('[2] Riproduzione note in Hz'); Writeln('[3] Riproduzione note inglesi'); Writeln('[4] Esci'); Readln(A); Clrscr; Case A of 1: Begin Writeln('Italiano: DO RE MI FA SOL LA SI'); WRiteln('Inglese: C D E F G A B'); Writeln('Francese: UT RE MI FA SOL LA SI'); WRiteln('Tedesco: C D E F G A H'); Writeln('Hz: 262 294 330 349 392 400 494'); Writeln; Writeln('[1] Ritorna al menù principale'); Writeln('[2] Esci'); Readln(b); Until B=1; If A=2 then halt; end; 2: Begin Repeat Writeln('Inserire gli Hz'); Readln(Hz); Writeln('Inserisci la durata'); Readln(durata); Delay(3000); Sound(Hz); Delay(durata); Nosound; Delay(3000); Clrscr; Writeln('[1] Ripeti'); Writeln('[2] Ritorna al menù principale'); Writeln('[3] Esci'); Readln(b); Until B=1; Until B=2; If A=3 then halt; end; 3: Begin Repeat Writeln('Inserire la nota'); Readln(C); Writeln('Inserisci la durata'); Readln(durata); Case C of C: Nota:=262; D: Nota:=294; E: Nota:=330; F: Nota:=349; G: Nota:=392; A: Nota:=400; B: Nota:=494; Delay(3000); Sound(Nota); Delay(durata); Nosound; Delay(3000); Clrscr; Writeln('[1] Ripeti'); Writeln('[2] Ritorna al menù principale'); Writeln('[3] Esci'); Readln(b); Until B=1; Until B=2; If A=3 then halt; end; 4: Halt; End.
Ecco l'errore:
music.pas(28,2) fatal: Syntax error, ";" expected but "UNTIL" found.
Sembra un errore semplice, ma non riesco a trovare il punto dove ho dimenticato il ";". La linea 28, é quella dove ho usato il primo "UNTIL".
aaa