Another basic example of IF THEN ELSE.
procedure TForm1.btnCheckClick(Sender: TObject); var age : Integer; begin age := StrToInt(edtAge.Text); if (age>=18) then ShowMessage('Congratulations! You are old enough to vote!') else ShowMessage('Sorry, you are not old enough to vote yet...'); end;
Download the project files here
Be the first to comment