⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 demounit.pas

📁 一个速度很快的文字排序引擎(TextSort engine)
💻 PAS
字号:
{+--------------------------------------------------------------------------+
 | Unit:   DemoUnit
 | Created:     12.07.97
 | Author:      Martin Waldenburg
 | Copyright    1997, all rights reserved.
 | Description: Demo for the TextSort engine.
 | Version:     1.0
 | Status       FreeWare
 | It's provided as is, without a warranty of any kind.
 | You use it at your own risc.
 | E-Mail me at Martin.Waldenburg@t-online.de
 +--------------------------------------------------------------------------+}
unit DemoUnit;

interface

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

type
  TForm1 = class(TForm)
    Button1: TButton;
    OpenDialog1: TOpenDialog;
    Label1: TLabel;
    Button2: TButton;
    Time1: TmwFastTime;
    procedure FormCreate(Sender: TObject);
    procedure FormDestroy(Sender: TObject);
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
  private
    TextSort: TTextSort;
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

function Compare(Item1, Item2: Pointer): Integer;
begin
   Result:= CompareText(PMergeData(Item1)^.Data, PMergeData(Item2)^.Data);
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
  TextSort:= TTextSort.Create(Compare);
end;

procedure TForm1.FormDestroy(Sender: TObject);
begin
  TextSort.Free;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  if OpenDialog1.Execute then
  TextSort.Init(OpenDialog1.FileName);
  TextSort.MaxLines:= 200000;
  TextSort.MaxMem:= 8000000;
  Time1.Start;
  TextSort.Start;
  Time1.Stop;
  Label1.Caption:= Time1.ElapsedTime;
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
  Close;
end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -