cyrs 发表于 2014-11-17 11:07:54

win7下提示错误

本帖最后由 cyrs 于 2014-11-18 11:59 编辑

unit Unit1;
interface
uses
   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
   Dialogs, StdCtrls;
type
   TForm1 = class(TForm)
   Edit1: TEdit;
   Button1: TButton;
   Button2: TButton;
   procedure Button1Click(Sender: TObject);
   procedure Button2Click(Sender: TObject);
   private
   { Private declarations }
   public
   { Public declarations }
   end;
var
   Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var odds,sum:integer;
begin
sum:=0;
odds:=1;
while odds<=   strtoint(Edit1.Text) do
begin
   sum:=sum+odds;
   odds:=odds+2;
end;
Showmessage(inttostr(sum));
end;
procedure TForm1.Button2Click(Sender: TObject);
var odds,sum:integer;
begin
sum:=0;
odds:=1;
Repeat
   sum:=sum+odds;
   odds:=odds+2;
until odds > strtoint(Edit1.Text);
Showmessage(inttostr(sum));
end;
end.

qq351317878 发表于 2014-11-17 11:36:49

提示什么???

qq351317878 发表于 2014-11-17 11:38:47

我可以运行啊,没问题啊

qq351317878 发表于 2014-11-17 11:40:59

你检查下你的窗体事件和窗体的控件什么是否和代码里的匹配,表示我用你的代码能运行

bestboyhjj 发表于 2014-11-22 08:30:59

看看,学学
页: [1]
查看完整版本: win7下提示错误