![]() |
|
#1
|
|||
|
|||
![]() как убрать эту ошибку
[Ñîâåò] Unit1.pas(760): Variable 'prsk' is declared but never used in 'TForm1.Timer1Timer' Если убрать ее то у меня будет ругаться [Îøèáêà] Unit1.pas(1014): Undeclared identifier: 'prsk' |
#2
|
||||
|
||||
![]() Мой магический шар подсказывает что экстрасенсы не придут =(
По теме: давай код, посмотри, исправим... |
#3
|
|||
|
|||
![]() Цитата:
Код:
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
|
|||
|
|||
![]() Цитата:
|
#5
|
||||
|
||||
![]() дай код от начала процедуры до енд
|
#6
|
||||
|
||||
![]() Цитата:
Меня греют ваши плюсы к моей репутации... |
#7
|
||||
|
||||
![]() [Совет] Unit1.pas(760): Variable 'prsk' is declared but never used in 'TForm1.Timer1Timer'
Переменная prsk объявлена, но не используется. [Ошибка] Unit1.pas(1014): Undeclared identifier: 'prsk' Добавь переменную prsk там, где компилятор выдает эту ошибку. Компилятор ее не видит. Помогаю за Спасибо ![]() |
#8
|
|||
|
|||
![]() Цитата:
Код:
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
|
|||
|
|||
![]() Цитата:
|
#10
|
||||
|
||||
![]() Мама моя родная - вот это портянка.
Вы про циклы, массивы процедуры слышали хоть краем уха. Это-же надо было такое породить. И не лень же было все это писать. Я на 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. |