Recent

Author Topic: Error: Incompatible types: got "untyped" expected "Boolean"  (Read 1515 times)

godik

  • New Member
  • *
  • Posts: 23
Error: Incompatible types: got "untyped" expected "Boolean"
« on: September 21, 2018, 04:23:25 pm »
Hello can you help me ? I am new to this program

https://ctrlv.cz/Biga

HeavyUser

  • Sr. Member
  • ****
  • Posts: 262
Re: Error: Incompatible types: got "untyped" expected "Boolean"
« Reply #1 on: September 21, 2018, 04:25:40 pm »
Hello can you help me ? I am new to this program

https://ctrlv.cz/Biga
Code: Pascal  [Select]
  1. if edit1.Text = 'idontknow' then..........
  2.  
notice the lack of : on the comparison statement.

godik

  • New Member
  • *
  • Posts: 23
Re: Error: Incompatible types: got "untyped" expected "Boolean"
« Reply #2 on: September 21, 2018, 09:34:44 pm »
Thanks ! i have another problem i want to make simple program.I have a number for example 16 and 10 and i want to make 2 Labels and 1 button.When i click to button i want to highlight the number which is higher. I have no idea how can i do this. Thank you for answer :)

Bart

  • Hero Member
  • *****
  • Posts: 3540
    • Bart en Mariska's Webstek
Re: Error: Incompatible types: got "untyped" expected "Boolean"
« Reply #3 on: September 21, 2018, 10:25:20 pm »
For example change the font color depending on the values of Nr1 and Nr2:

Code: Pascal  [Select]
  1. var
  2.    Nr1, Nr2: Integer;
  3. ...
  4. begin
  5.   if Nr1 > Nr2 then
  6.   begin
  7.     Label1.Font.Color := clRed;
  8.     Label2.Font.Color := clBlack;
  9.   end
  10.   else
  11.   begin
  12.      if Nr2 > Nr1 then
  13.     begin
  14.       Label1.Font.Color := clBlack;
  15.       Label2.Font.Color := clRed;
  16.     end
  17.     else
  18.     begin
  19.       Label1.Font.Color := clGreen;
  20.       Label2.Font.Color := clGreen;
  21.     end;
  22.   end;
  23. end;

Bart