Неплохо, но оптимизации тут чуть меньше, чем нисколько.
Кусок кода:
____________________________________________________________
if q=23 then begin
if not openPlayer('/23.wav', 'audio/x-wav') then halt;
if not setPlayerCount(1) then halt;
if not startPlayer then halt;
delay(1200);
stopplayer;
if not openPlayer('/hour3.wav', 'audio/x-wav') then halt;
if not setPlayerCount(1) then halt;
if not startPlayer then halt;
delay(1200);
stopplayer;
end;
if q=22 then begin
if not openPlayer('/22.wav', 'audio/x-wav') then halt;
if not setPlayerCount(1) then halt;
if not startPlayer then halt;
delay(1200);
stopplayer;
if not openPlayer('/hour3.wav', 'audio/x-wav') then halt;
if not setPlayerCount(1) then halt;
if not startPlayer then halt;
delay(1200);
stopplayer;
end;
___________________________________________
правильней:
______________________________________________________
procedure say_time (a,b:integer);
begin
if not openPlayer('/'+integertostring(a)+'.wav', 'audio/x-wav') then halt;
if not setPlayerCount(1) then halt;
if not startPlayer then halt;
delay(1200);
stopplayer;
if not openPlayer('/hour'+integertostring(b)+'.wav', 'audio/x-wav') then halt;
if not setPlayerCount(1) then halt;
if not startPlayer then halt;
delay(1200);
stopplayer;
end;
....................
say_time (23,3);
say_time (22,3);
....................