tools.pas

来自「flash视频源码 flash视频源码」· PAS 代码 · 共 37 行

PAS
37
字号
unit tools;

interface

uses Classes;

procedure DivUp(st,sep:string;sl:TStrings;min,max:Byte);
function GetCheckSum(st:string):Integer;

implementation

uses crc32;

procedure DivUp(st,sep:string;sl:TStrings;min,max:Byte);
var i,l:Integer;
  begin
    Dec(max);
    l:=Length(sep);
    sl.Clear;
    while st<>'' do
      begin
        i:=Pos(sep,st);
        if (i=0)or(max=sl.Count) then i:=Length(st)+1;
        sl.Add(Copy(st,1,i-1));
        Delete(st,1,i+l-1);
      end;
    while sl.Count<min do sl.Add('');
  end;

function GetCheckSum(st:string):Integer;
  begin
    Result:=Length(st);
    if Result=0 then Exit;
    CalcCRC32(@st[1],Length(st),Result);
  end;

end.

⌨️ 快捷键说明

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