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 取正在运行的dll或exe的路径

Delphi 创建console-控制台应用

Delphi 解析 png 图片的十六进制字符流

Delphi的webbrowser改造,对网页中alter等对话框的改造方法

Delphi sendmessage这个函数有很多奇妙的用途

isnumeric 判断字符串是否为数字

Delphi新的变量的声明方法

Delphi程序的exe和dll文件添加版本信息

Delphi winapi: getdesktopwindow - 返回桌面窗口的句柄

Delphi ado 连接 excel (附excel各个版本的版本号)

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



打赏

取消

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

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

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

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

评论

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