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

相关阅读 >>

Delphi richedit1 设置字体

Delphi 高亮选中memo某一行

Delphi rs232c接脚与对连线

Delphi下调用有返回值的存储过程

Delphi rect()

Delphi动态建立panel无法更改颜色?

Delphi 取正在运行的dll或exe的路径

Delphi 中 findwindow 和 findwindowex 的语法和用法

Delphi tpicture 和 tbitmap 的相互转换

Delphi xe8 androdi利用httpclient实现的一个app自动更新组件

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



打赏

取消

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

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

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

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

评论

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