IF THEN ELSE


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;

 


The rest of this content is available to full members. Full membership of the site is available by either donating R100 on the Donation page, or uploading an activity or assessment that you yourself have created to share with others (on the Upload page).

 

Similar Posts: