Об игре
Новости
Войти
Регистрация
Рейтинг
Форум
6:02
1537
 online
Требуется авторизация
Вы не авторизованы
   Форумы-->Форум для внеигровых тем-->

АвторПомощь по Дельфи
procedure TForm1.Button1Click(Sender: TObject);
var a, b, c, d:real;
begin
a:=strtofloat(edit1.Text);
b:=strtofloat(edit2.Text);
c:=strtofloat(edit3.Text);
d:=strtofloat(edit4.Text);

If a>c and b>d then Label5.caption:='Áåðåì íà ðàáîòó' else
If a<c and b>d then Label5.caption:='&#205;&#229; &#225;&#229;&#240;&#229;&#236; &#237;&#224; &#240;&#224;&#225;&#238;&#242;&#243;' else
If a>c and b<d then Label5.caption:='&#205;&#229; &#225;&#229;&#240;&#229;&#236; &#237;&#224; &#240;&#224;&#225;&#238;&#242;&#243;' else
If a<c and b<d then Label5.caption:='&#205;&#229; &#225;&#229;&#240;&#229;&#236; &#237;&#224; &#240;&#224;&#225;&#238;&#242;&#243;' else


end;

end.

Пишет [Error] Unit1.pas(45): Operator not applicable to this operand type

Что за беда?
a:=strtofloat(edit1.Text);
b:=strtofloat(edit2.Text);
c:=strtofloat(edit3.Text);
d:=strtofloat(edit4.Text);

На форме ячейки для ввода данных а, в,с, strtofloat преобразование сисволов типа строки в тип данных float, в не целый числовой тип данных
Эти ссылки не работают, помогите человеку!
Если выполняется a>c and b>d это условие то на форме будет выведена вот лта хрень - &#193;&#229;&#240;&#229;&#236; &#237;&#224; &#240;&#224;&#225;&#238;&#242;&#243
Если выполняется a<c and b>d это условие то на форме будет выведена другая хрень -&#205;&#229; &#225;&#229;&#240;&#229;&#236; &#237;&#224; &#240;&#224;&#225;&#238;&#242;&#243;
и так далее
а блин ты об ошибке [Error] Unit1.pas(45): Operator not applicable to this operand type, библиотеки какието не добавлены
Пишет [Error] Unit1.pas(45): Operator not applicable to this operand type
Какая строка подсвечивается-то?
If a>c and b>d
Если ошибка в этой строке, нужно писать так:
If (a<c) and (b>d)
procedure TForm1.Button1Click(Sender: TObject);
var a, b, c, d:real;
begin
a:=strtofloat(edit1.Text);
b:=strtofloat(edit2.Text);
c:=strtofloat(edit3.Text);
d:=strtofloat(edit4.Text);

If (a>=c) and (b>=d) then Label5.caption:='Берем на работу' else
If (a<=c) and (b>=d) then Label5.caption:='не Берем на работу' else
If (a>=c) and (b<=d) then Label5.caption:='не Берем на работу' else
If (a<=c) and (b<=d) then Label5.caption:='не Берем на работу' else
end;
end.

Все пашет кроме того что три последние иф на пашут. то бишь сообщение не выходит...
Пардон тут будет
If (a>=c) and (b>=d) then Label5.caption:='Берем на работу' else
If (a<c) and (b>d) then Label5.caption:='не Берем на работу' else
If (a>c) and (b<d) then Label5.caption:='не Берем на работу' else
If (a<c) and (b<d) then Label5.caption:='не Берем на работу' else
попробуй без елсев, они у меня постоянно глючали
смысла в них никакого, и последний елсе для чего?
If (a>=c) and (b>=d) then Label5.caption:='Берем на работу' ;
If (a<c) and (b>d) then Label5.caption:='не Берем на работу';
If (a>c) and (b<d) then Label5.caption:='не Берем на работу';
If (a<c) and (b<d) then Label5.caption:='не Берем на работу';

так попробуй
К списку тем
2007-2025, онлайн игры HeroesWM