Delphi声明Record变量后直接初始化

时间:2017-01-17 14:11:42   收藏:0   阅读:907

 TARec = record
    A1: string;
    A2: string;
  end;

  TBRec = record
    A1: string;
    A2: string;
    ARec: TARec;
  end;

  PAppWindow = ^TAppWindow;
  TAppWindow = Record
    Width, Height : Integer;
    CaptionBarHeight : Integer;
  end;

var
  FARec: TARec = (A1: ‘‘; A2: ‘‘);
  BRec: TBRec = (A1: ‘‘; A2: ‘‘; ARec: (A1: ‘‘; A2: ‘‘));
  i: Integer = 100;

  Window : TAppWindow = (Width:800; Height:600; CaptionBarHeight:26);

全局变量可以直接初始化,但是局部变量不允许。

原文:http://www.cnblogs.com/yzryc/p/6292706.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!