to com um peq pro no meu estudo aki, ele da o seg ero:
[Error] Unit1.pas(53): ';' not allowed before 'ELSE'
o cod a minha unit é:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Label1: TLabel;
Edit1: TEdit;
Button1: TButton;
GroupBox1: TGroupBox;
Label2: TLabel;
Edit3: TEdit;
Edit2: TEdit;
Label5: TLabel;
Label4: TLabel;
Label3: TLabel;
RadioButton1: TRadioButton;
RadioButton2: TRadioButton;
Edit4: TEdit;
procedure Button1Click(Sender: TObject);
procedure Edit1KeyPress(Sender: TObject; var Key: Char);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
valoremreal : real;
valordaraiz : real;
parteinteira : real;
partefracionaria : real;
begin
valoremreal := strtofloat(edit1.Text);
valordaraiz := sqrt(valoremreal);
edit2.Text := floattostr(valordaraiz);
parteinteira := int(valordaraiz);
partefracionaria := valordaraiz - parteinteira;
if strtoint(edit1.Text) mod 2 = 0 then
label2.Caption := edit1.Text + ' o nº é par';
else
label2.Caption := edit1.Text + ' o nº é ímpar';
if partefracionaria = 0 then
begin
radiobutton1.Checked := true;
edit3.Text := floattostr(parteinteira);
edit1.Text := '0';
end
else
begin
radiobutton2.Checked := true;
edit3.Text := floattostr(parteinteira);
edit4.Text := floattostr(partefracionaria);
end;
end;
procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);
begin
if not (key in ['0'..'9']) then key := '0';
end;
end.
Novos endereços, o Yahoo! que você conhece. Crie um email novo com a sua
cara @ymail.com ou @rocketmail.com.
http://br.new.mail.yahoo.com/addresses
[As partes desta mensagem que não continham texto foram removidas]