其实这也是个 Copy 函数, 和 Move 没有关系.
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs;

type
  TForm1 = class(TForm)
    procedure FormCreate(Sender: TObject);
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
var
  p: PChar;
begin
  p := PChar(StringOfChar('A', 9));

  StrMove(p, '12345', 3);
  ShowMessage(p); {123AAAAAA}

  StrMove(p, '67890', 5);
  ShowMessage(p); {67890AAAA}

  StrMove(p, '12345', 7);
  ShowMessage(p); {12345}
end;

end.

SysUtils 单元下的公用函数目录

posted on 2008-05-13 09:59  万一  阅读(2457)  评论(0编辑  收藏  举报