procedure TForm1.Button1Click(Sender: TObject);
var
  s1: ShortString;  //为兼容老版本而存在
  s2: string;       //长字串,相当于动态字符数组
  s3: string[10];   //短字串,相当于静态字符数组,代替 ShortString
begin
  ShowMessage(IntToStr(SizeOf(s1)));  //256
  ShowMessage(IntToStr(SizeOf(s2)));  //4
  ShowMessage(IntToStr(SizeOf(s3)));  //11
end;
posted on 2007-12-02 12:26  万一  阅读(2889)  评论(5编辑  收藏  举报