鱼C论坛

 找回密码
 立即注册
查看: 2108|回复: 4

[已解决]这个程序能执行就是不显示数字在Lable

[复制链接]
发表于 2015-7-26 11:01:02 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能^_^

您需要 登录 才可以下载或查看,没有账号?立即注册

x
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm1 = class(TForm)
    Edit1: TEdit;
    Button1: TButton;
    Button2: TButton;
    Label1: TLabel;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
   
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation
var
  num:Array[1..100]of Integer;
  i:Integer=1;

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  Label1.Caption:=label1.Caption+''+Edit1.Text;
  num[i]:=StrToInt(Edit1.Text);
  i:=i+1;
  Edit1.Text:='';


end;

procedure TForm1.Button2Click(Sender: TObject);
var
  l,j,k,n:Integer;
begin
    For l:=1 to i-1 do
    begin
      k:=i-l;
      For j:=1 to k do
      begin
          If(num[j]<num[j+1])then
            begin
               n:=num[j];
               num[j]:=num[j+1];
               num[j+1]:=n;
            end;
       end;
     end;
    label1.Caption:='';
    For l:=i-1 Downto 1 do
    Label1.Caption:=Label1.Caption+IntToStr(num[l])+'';
    end;




end.
最佳答案
2015-7-26 17:15:46
感覺for迴圈沒執行
請問是要執行什麼功能??
可以上傳你的檔案嗎
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

发表于 2015-7-26 17:15:46 | 显示全部楼层    本楼为最佳答案   
感覺for迴圈沒執行
請問是要執行什麼功能??
可以上傳你的檔案嗎
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

 楼主| 发表于 2015-7-27 09:12:04 | 显示全部楼层
这是小甲鱼第十九课的例子执行数字大小排序
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

 楼主| 发表于 2015-7-27 09:14:14 | 显示全部楼层
程序检查是对的
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2015-7-29 18:27:29 | 显示全部楼层
label visible有 true嗎
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2024-4-28 15:03

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表