-1
I’m having a doubt in an exercise where I have to show which number is the least or the most insane.
But it’s not bringing the right result.
Segue o código.
unit Unit1;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls;
type
TForm1 = class(TForm)
lblN1: TLabel;
lblN2: TLabel;
edtN1: TEdit;
edtN2: TEdit;
btnMostrar: TButton;
procedure btnMostrarClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.btnMostrarClick(Sender: TObject);
var
edtN1 : Integer;
edtN2: Integer;
begin
if edtN1.Size > edtN2.Size then
ShowMessage('O número 1 é o maior!')
else
ShowMessage('O número 2 é o maior!');
end;
end.
I realized that edt always receives string, so soon you have to convert. Thanks however gave another error "integer does not containt a Member named 'Text'
– Matheus Lima
@Matheuslima the error presented
integer does not containt a member named 'Text
is exactly what I answered.– Junior Moreira
Matheus I can bet you put a ')' in the wrong place :D That code I put there has to compile... Certainly not pos Strtoint(edtN1). Text instead of Strtoint(edtN1.Text)?
– Tiago Rodrigues