Форум по Delphi программированию

Delphi Sources



Вернуться   Форум по Delphi программированию > Все о Delphi > [ "Начинающим" ]
Ник
Пароль
Регистрация <<         Правила форума         >> FAQ Пользователи Календарь Поиск Сообщения за сегодня Все разделы прочитаны

Ответ
 
Опции темы Поиск в этой теме Опции просмотра
  #1  
Старый 24.01.2011, 14:13
TotKtoNado TotKtoNado вне форума
Начинающий
 
Регистрация: 28.12.2010
Адрес: Сургут
Сообщения: 103
Версия Delphi: 2010
Репутация: -3238
По умолчанию как убрать?

как убрать эту ошибку
[Ñîâåò] Unit1.pas(760): Variable 'prsk' is declared but never used in 'TForm1.Timer1Timer'
Если убрать ее то у меня будет ругаться
[Îøèáêà] Unit1.pas(1014): Undeclared identifier: 'prsk'
Ответить с цитированием
  #2  
Старый 24.01.2011, 14:35
Аватар для Hack M
Hack M Hack M вне форума
Прохожий
 
Регистрация: 20.01.2011
Сообщения: 26
Репутация: 10
По умолчанию

Мой магический шар подсказывает что экстрасенсы не придут =(

По теме: давай код, посмотри, исправим...
Ответить с цитированием
  #3  
Старый 24.01.2011, 14:44
TotKtoNado TotKtoNado вне форума
Начинающий
 
Регистрация: 28.12.2010
Адрес: Сургут
Сообщения: 103
Версия Delphi: 2010
Репутация: -3238
По умолчанию

Цитата:
Сообщение от Hack M
Мой магический шар подсказывает что экстрасенсы не придут =(

По теме: давай код, посмотри, исправим...
Код:
begin
prsk:=strtofloat(edit26.text);
prsksum:=strtofloat(edit32.Text);
zatsk:=strtofloat(edit29.Text);
zatsksum:=strtofloat(edit11.Text);
label36.caption:=floattostr((prsk*prsksum)-(zatsk*zatsksum));
end;

объявил переменные
Код:
prsk,prsksum,zatsk,zatsksum:real;
Ответить с цитированием
  #4  
Старый 24.01.2011, 14:46
TotKtoNado TotKtoNado вне форума
Начинающий
 
Регистрация: 28.12.2010
Адрес: Сургут
Сообщения: 103
Версия Delphi: 2010
Репутация: -3238
По умолчанию

Цитата:
Сообщение от Hack M
Мой магический шар подсказывает что экстрасенсы не придут =(

По теме: давай код, посмотри, исправим...
я пробовл 2 таймер разместить, так он вобще что то не считает
Ответить с цитированием
  #5  
Старый 24.01.2011, 15:36
Аватар для Hack M
Hack M Hack M вне форума
Прохожий
 
Регистрация: 20.01.2011
Сообщения: 26
Репутация: 10
По умолчанию

дай код от начала процедуры до енд
Ответить с цитированием
  #6  
Старый 24.01.2011, 15:51
Аватар для BoRoV
BoRoV BoRoV вне форума
Начинающий
 
Регистрация: 08.09.2008
Сообщения: 193
Репутация: 12694
По умолчанию

Цитата:
Сообщение от TotKtoNado
[Ñîâåò] Unit1.pas(760): Variable 'prsk' is declared but never used in 'TForm1.Timer1Timer'
Это ведь не ошибка, а предупреждение.
__________________
Меня греют ваши плюсы к моей репутации...
Ответить с цитированием
  #7  
Старый 24.01.2011, 16:18
Аватар для v1s2222
v1s2222 v1s2222 вне форума
Продвинутый
 
Регистрация: 07.09.2010
Сообщения: 726
Репутация: 26711
По умолчанию

[Совет] Unit1.pas(760): Variable 'prsk' is declared but never used in 'TForm1.Timer1Timer'
Переменная prsk объявлена, но не используется.

[Ошибка] Unit1.pas(1014): Undeclared identifier: 'prsk'
Добавь переменную prsk там, где компилятор выдает эту ошибку. Компилятор ее не видит.
__________________
Помогаю за Спасибо
Ответить с цитированием
  #8  
Старый 25.01.2011, 10:43
TotKtoNado TotKtoNado вне форума
Начинающий
 
Регистрация: 28.12.2010
Адрес: Сургут
Сообщения: 103
Версия Delphi: 2010
Репутация: -3238
По умолчанию

Цитата:
Сообщение от Hack M
дай код от начала процедуры до енд
Код:
procedure TForm1.Timer1Timer(Sender: TObject);
var a1,a2,a3,a4,a5,pr1,pr2,pr3,pr4,pr5,pr6,pr7,pr8,pr9,pr10,pr11,pr12,pr13,pr14,pr15,pr16,pr17,pr18,pr19,pr20,pr21,pr22,prsk,prsksum,zatsk,zatsksum:real;
begin
begin
a1:=strtofloat(edit2.text);
a2:=strtofloat(edit5.text);
a3:=strtoint(edit8.text);
label157.caption:=floattostr((a1*a3-a2)/90);
if label157.caption >inttostr(0) then label157.Color:=clLime;
if label157.caption <inttostr(0) then label157.Color:=cLRed;
if label157.caption =inttostr(0) then label157.Color:=clBtnFace;
end;
begin
a1:=strtofloat(edit14.text);
a2:=strtofloat(edit17.text);
a3:=strtoint(edit20.text);
label163.caption:=floattostr((a1*a3-a2)/90);
if label163.caption >inttostr(0) then label163.Color:=clLime;
if label163.caption <inttostr(0) then label163.Color:=cLRed;
if label163.caption =inttostr(0) then label163.Color:=clBtnFace;
end;
begin
a1:=strtofloat(edit62.text);
a2:=strtofloat(edit65.text);
a3:=strtoint(edit68.text);
label180.caption:=floattostr((a1*a3-a2)/90);
if label180.caption >inttostr(0) then label180.Color:=clLime;
if label180.caption <inttostr(0) then label180.Color:=cLRed;
if label180.caption =inttostr(0) then label180.Color:=clBtnFace;
end;
begin
a1:=strtofloat(edit38.text);
a2:=strtofloat(edit41.text);
a3:=strtoint(edit44.text);
label287.caption:=floattostr((a1*a3-a2)/90);
if label287.caption >inttostr(0) then label287.Color:=clLime;
if label287.caption <inttostr(0) then label287.Color:=cLRed;
if label287.caption =inttostr(0) then label287.Color:=clBtnFace;
end;
begin
a1:=strtofloat(edit74.text);
a2:=strtofloat(edit75.text);
a3:=strtoint(edit76.text);
label288.caption:=floattostr((a1*a3-a2)/90);
if label288.caption >inttostr(0) then label288.Color:=clLime;
if label288.caption <inttostr(0) then label288.Color:=cLRed;
if label288.caption =inttostr(0) then label288.Color:=clBtnFace;
end;
 begin
a1:=strtofloat(edit82.text);
a2:=strtofloat(edit83.text);
a3:=strtoint(edit84.text);
label289.caption:=floattostr((a1*a3-a2)/90);
if label289.caption >inttostr(0) then label289.Color:=clLime;
if label289.caption <inttostr(0) then label289.Color:=cLRed;
if label289.caption =inttostr(0) then label289.Color:=clBtnFace;
end;
 begin
a1:=strtofloat(edit90.text);
a2:=strtofloat(edit91.text);
a3:=strtoint(edit92.text);
label290.caption:=floattostr((a1*a3-a2)/90);
if label290.caption >inttostr(0) then label290.Color:=clLime;
if label290.caption <inttostr(0) then label290.Color:=cLRed;
if label290.caption =inttostr(0) then label290.Color:=clBtnFace;
end;
 begin
a1:=strtofloat(edit98.text);
a2:=strtofloat(edit99.text);
a3:=strtoint(edit100.text);
label291.caption:=floattostr((a1*a3-a2)/90);
if label291.caption >inttostr(0) then label291.Color:=clLime;
if label291.caption <inttostr(0) then label291.Color:=cLRed;
if label291.caption =inttostr(0) then label291.Color:=clBtnFace;
end;
 begin
a1:=strtofloat(edit106.text);
a2:=strtofloat(edit107.text);
a3:=strtoint(edit108.text);
label292.caption:=floattostr((a1*a3-a2)/90);
if label292.caption >inttostr(0) then label292.Color:=clLime;
if label292.caption <inttostr(0) then label292.Color:=cLRed;
if label292.caption =inttostr(0) then label292.Color:=clBtnFace;
end;
 begin
a1:=strtofloat(edit114.text);
a2:=strtofloat(edit115.text);
a3:=strtoint(edit116.text);
label293.caption:=floattostr((a1*a3-a2)/90);
if label293.caption >inttostr(0) then label293.Color:=clLime;
if label293.caption <inttostr(0) then label293.Color:=cLRed;
if label293.caption =inttostr(0) then label293.Color:=clBtnFace;
end;
 begin
a1:=strtofloat(edit122.text);
a2:=strtofloat(edit123.text);
a3:=strtoint(edit124.text);
label295.caption:=floattostr((a1*a3-a2)/90);
if label295.caption >inttostr(0) then label295.Color:=clLime;
if label295.caption <inttostr(0) then label295.Color:=cLRed;
if label295.caption =inttostr(0) then label295.Color:=clBtnFace;
end;
 begin
a1:=strtofloat(edit214.text);
a2:=strtofloat(edit224.text);
a3:=strtoint(edit234.text);
label295.caption:=floattostr((a1*a3-a2)/90);
if label295.caption >inttostr(0) then label295.Color:=clLime;
if label295.caption <inttostr(0) then label295.Color:=cLRed;
if label295.caption =inttostr(0) then label295.Color:=clBtnFace;
end;
 begin
a1:=strtofloat(edit214.text);
a2:=strtofloat(edit224.text);
a3:=strtoint(edit84.text);
label295.caption:=floattostr((a1*a3-a2)/90);
if label295.caption >inttostr(0) then label295.Color:=clLime;
if label295.caption <inttostr(0) then label295.Color:=cLRed;
if label295.caption =inttostr(0) then label295.Color:=clBtnFace;
end;
begin
a1:=strtofloat(edit213.text);
a2:=strtofloat(edit223.text);
a3:=strtoint(edit233.text);
label296.caption:=floattostr((a1*a3-a2)/90);
if label296.caption >inttostr(0) then label296.Color:=clLime;
if label296.caption <inttostr(0) then label296.Color:=cLRed;
if label296.caption =inttostr(0) then label296.Color:=clBtnFace;
end;
begin
a1:=strtofloat(edit215.text);
a2:=strtofloat(edit225.text);
a3:=strtoint(edit236.text);
label297.caption:=floattostr((a1*a3-a2)/90);
if label297.caption >inttostr(0) then label297.Color:=clLime;
if label297.caption <inttostr(0) then label297.Color:=cLRed;
if label297.caption =inttostr(0) then label297.Color:=clBtnFace;
end;
begin
a1:=strtofloat(edit218.text);
a2:=strtofloat(edit228.text);
a3:=strtoint(edit238.text);
label298.caption:=floattostr((a1*a3-a2)/90);
if label298.caption >inttostr(0) then label298.Color:=clLime;
if label298.caption <inttostr(0) then label298.Color:=cLRed;
if label298.caption =inttostr(0) then label298.Color:=clBtnFace;
end;
begin
a1:=strtofloat(edit217.text);
a2:=strtofloat(edit227.text);
a3:=strtoint(edit237.text);
label299.caption:=floattostr((a1*a3-a2)/90);
if label299.caption >inttostr(0) then label299.Color:=clLime;
if label299.caption <inttostr(0) then label299.Color:=cLRed;
if label299.caption =inttostr(0) then label299.Color:=clBtnFace;
end;
begin
a1:=strtofloat(edit220.text);
a2:=strtofloat(edit230.text);
a3:=strtoint(edit240.text);
label301.caption:=floattostr((a1*a3-a2)/90);
if label301.caption >inttostr(0) then label301.Color:=clLime;
if label301.caption <inttostr(0) then label301.Color:=cLRed;
if label301.caption =inttostr(0) then label301.Color:=clBtnFace;
end;
begin
a1:=strtofloat(edit219.text);
a2:=strtofloat(edit229.text);
a3:=strtoint(edit239.text);
label300.caption:=floattostr((a1*a3-a2)/90);
if label300.caption >inttostr(0) then label300.Color:=clLime;
if label300.caption <inttostr(0) then label300.Color:=cLRed;
if label300.caption =inttostr(0) then label300.Color:=clBtnFace;
end;
begin
a1:=strtofloat(edit122.text);
a2:=strtofloat(edit123.text);
a3:=strtoint(edit124.text);
label294.caption:=floattostr((a1*a3-a2)/90);
if label294.caption >inttostr(0) then label294.Color:=clLime;
if label294.caption <inttostr(0) then label294.Color:=cLRed;
if label294.caption =inttostr(0) then label294.Color:=clBtnFace;
end;
begin
a1:=strtofloat(edit222.text);
a2:=strtofloat(edit232.text);
a3:=strtoint(edit242.text);
a4:=strtofloat(edit278.text);
a5:=strtoint(edit302.text);
label302.caption:=floattostr(((a1*a3-a2)-(a4*a5))/220);
if label302.caption >inttostr(0) then label302.Color:=clLime;
if label302.caption <inttostr(0) then label302.Color:=cLRed;
if label302.caption =inttostr(0) then label302.Color:=clBtnFace;
end;
begin
a1:=strtofloat(edit221.text);
a2:=strtofloat(edit231.text);
a3:=strtoint(edit241.text);
a4:=strtofloat(edit279.text);
a5:=strtoint(edit303.text);
label303.caption:=floattostr(((a1*a3-a2)-(a4*a5))/220);
if label303.caption >inttostr(0) then label303.Color:=clLime;
if label303.caption <inttostr(0) then label303.Color:=cLRed;
if label303.caption =inttostr(0) then label303.Color:=clBtnFace;
end;
begin
a1:=strtofloat(edit253.text);
a2:=strtofloat(edit255.text);
a3:=strtoint(edit257.text);
a4:=strtofloat(edit280.text);
a5:=strtoint(edit304.text);
label304.caption:=floattostr(((a1*a3-a2)-(a4*a5))/220);
if label304.caption >inttostr(0) then label304.Color:=clLime;
if label304.caption <inttostr(0) then label304.Color:=cLRed;
if label304.caption =inttostr(0) then label304.Color:=clBtnFace;
end;
begin
a1:=strtofloat(edit254.text);
a2:=strtofloat(edit256.text);
a3:=strtoint(edit258.text);
a4:=strtofloat(edit281.text);
a5:=strtoint(edit305.text);
label305.caption:=floattostr(((a1*a3-a2)-(a4*a5))/220);
if label305.caption >inttostr(0) then label305.Color:=clLime;
if label305.caption <inttostr(0) then label305.Color:=cLRed;
if label305.caption =inttostr(0) then label305.Color:=clBtnFace;
end;
pr1:=strtofloat(label157.caption);
pr2:=strtofloat(label163.caption);
pr3:=strtofloat(label180.caption);
pr4:=strtofloat(label287.caption);
pr5:=strtofloat(label288.caption);
pr6:=strtofloat(label289.caption);
pr7:=strtofloat(label290.caption);
pr8:=strtofloat(label291.caption);
pr9:=strtofloat(label292.caption);
pr10:=strtofloat(label293.caption);
pr11:=strtofloat(label294.caption);
pr12:=strtofloat(label295.caption);
pr13:=strtofloat(label296.caption);
pr14:=strtofloat(label297.caption);
pr15:=strtofloat(label298.caption);
pr16:=strtofloat(label299.caption);
pr17:=strtofloat(label301.caption);
pr18:=strtofloat(label300.caption);
pr19:=strtofloat(label302.caption);
pr20:=strtofloat(label303.caption);
pr21:=strtofloat(label304.caption);
pr22:=strtofloat(label305.caption);
label63.caption:=floattostr(pr1+pr2+pr3+pr4+pr5+pr6+pr7+pr8+pr9+pr10+pr11+pr12+pr13+pr14+pr15+pr16+pr17+pr18+pr19+pr20+pr21+pr22);
if label63.caption >inttostr(0) then label63.Color:=clLime;
if label63.caption <inttostr(0) then label63.Color:=cLRed;
if label63.caption =inttostr(0) then label63.Color:=clBtnFace;
end;

begin
prsk:=strtofloat(edit26.text);
prsksum:=strtofloat(edit32.Text);
zatsk:=strtofloat(edit29.Text);
zatsksum:=strtofloat(edit11.Text);
label36.caption:=floattostr((prsk*prsksum)-(zatsk*zatsksum));
end;
Ответить с цитированием
  #9  
Старый 25.01.2011, 10:45
TotKtoNado TotKtoNado вне форума
Начинающий
 
Регистрация: 28.12.2010
Адрес: Сургут
Сообщения: 103
Версия Delphi: 2010
Репутация: -3238
По умолчанию

Цитата:
Сообщение от v1s2222
[Совет] Unit1.pas(760): Variable 'prsk' is declared but never used in 'TForm1.Timer1Timer'
Переменная prsk объявлена, но не используется.

[Ошибка] Unit1.pas(1014): Undeclared identifier: 'prsk'
Добавь переменную prsk там, где компилятор выдает эту ошибку. Компилятор ее не видит.
но я же использую переменную prsk
Ответить с цитированием
  #10  
Старый 25.01.2011, 11:05
Аватар для Страдалецъ
Страдалецъ Страдалецъ вне форума
Гуру
 
Регистрация: 09.03.2009
Адрес: На курорте, из окна вижу теплое Баренцево море. Бррр.
Сообщения: 4,723
Репутация: 52347
По умолчанию

Мама моя родная - вот это портянка.
Вы про циклы, массивы процедуры слышали хоть краем уха. Это-же надо было такое породить. И не лень же было все это писать. Я на 20 строчке уже бы задумался, как это дело оптимизировать. Ведь блоки постоянно повторяются. Зачем вы их берете в begin ... end?
И поясните что вы такое делаете этой строчкой?
Код:
if label304.caption >inttostr(0) then label304.Color:=clLime;
Как-то я смутно подозреваю, что имелось ввиду вот такое:
Код:
if StrToInt(label304.caption) > 0 then label304.Color:=clLime;

И наконец, ваша переменная prsk описана как локальная переменная процедуры TForm1.Timer1Timer(Sender: TObject), а вот обращение видимо к ней происходит за пределами этой процедуры. Вы этими бесконечными begin ... end сами себя запутали.
Приведите код в порядок, многое станет очевидно.
__________________
Жизнь такова какова она есть и больше никакова.
Помогаю за спасибо.

Последний раз редактировалось Страдалецъ, 25.01.2011 в 11:11.
Ответить с цитированием
Ответ


Delphi Sources

Опции темы Поиск в этой теме
Поиск в этой теме:

Расширенный поиск
Опции просмотра

Ваши права в разделе
Вы не можете создавать темы
Вы не можете отвечать на сообщения
Вы не можете прикреплять файлы
Вы не можете редактировать сообщения

BB-коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход


Часовой пояс GMT +3, время: 16:42.


 

Сайт

Форум

FAQ

Соглашения

Прочее

 

Copyright © Форум "Delphi Sources" by BrokenByte Software, 2004-2025