举例:
var
  ss,s: string;
begin
  ss := 'CodeGear Delphi 2007';
  SetString(s,PChar(ss),4);
  ShowMessage(s); {Code}
end;

var s: string; arr: array[0..6] of Char; i: Integer; begin for i := 0 to 6 do arr[i] := Chr(i + 65); ShowMessage(arr); {ABCDEFG} SetString(s, PChar(@arr), 3); ShowMessage(s); {ABC} end;
System 单元下的公用函数目录

posted on 2008-03-29 22:58  万一  阅读(7112)  评论(3编辑  收藏  举报