Авторизироваться
Меню сайта
Категории раздела
Наш опрос
Вы программируете на MP?
Всего ответов: 647
Мини-чат
210
Статистика

Онлайн : 1
Гостей: 1
Пользователей: 0
Главная » Каталог сайтов » К программам » Время и дата

Исходник TALKING CLOCK
19.07.2009, 08:22
Говорит текущее время. Автор:Brevis.
Переходов: 0 | Добавил: admin | Рейтинг: 0.0/0
Всего комментариев: 1
02.07.2011 в 22:31 Спам
Неплохо, но оптимизации тут чуть меньше, чем нисколько.

Кусок кода:
____________________________________________________________
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);
....................
Добавлять комментарии могут только зарегистрированные пользователи.
[ Регистрация | Вход ]