SystemOdd (Delphi)
Description
This example requires a text edit and a button with a clear canvas in the upper-left corner of the form. Enter the number to be tested in the text edit and click the button to test whether the entry is odd.
Code
procedure TForm1.Button1Click(Sender: TObject);
begin
Canvas.TextOut(10, 10, ' ');
if Odd(StrToInt(Edit1.Text)) then
Canvas.TextOut(10, 10, Edit1.Text + ' is odd.')
else
Canvas.TextOut(10, 10, Edit1.Text + ' is even.');
end;
Uses
- System.Odd ( fr | de | ja )