随笔 - 2146  文章 - 97 评论 - 11767 trackbacks - 253

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  万一  阅读(...)  评论(...编辑  收藏