Delphi memo1 数字列设定取值范围


本文整理自网络,侵删。

 
Memo1内容:
1
2
3
4
5
6
7
8
9
10


unit Unit2;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls;

type
  TForm2 = class(TForm)
    Memo1: TMemo;
    Memo2: TMemo;
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form2: TForm2;

implementation

{$R *.dfm}

procedure TForm2.Button1Click(Sender: TObject);
var
  I: Integer;
begin
for I := 0 to Memo1.Lines.Count-1 do
begin

if (strtoint(Memo1.Lines.Strings[i])>=5) and (strtoint(Memo1.Lines.Strings[i])<=8) then
begin
  Memo2.Lines.Add(Memo1.Lines.Strings[i]);
end;
end;

end;

end.


结果:
5
6
7
8

相关阅读 >>

Delphi10.3 构造生成输出json数据

Delphi xe5 for android memo控件 无法读取txt文件

Delphi 加载图像并压缩,旋转图像角度

Delphi怎样读取excel表的所有字段名

Delphi 根据文本高度确定richedit高度

Delphi 获取鼠标与键盘空闲时间

Delphi 访问https图片

Delphi 禁止截屏printscreen

Delphi scrollbox1滚动框鼠标滚轮

Delphi编辑环境

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...