const
  BasePoint:TPoint=Point(449;36);
我使用以上代码出现‘(’expected but identifier 'Point' found
我该怎么办呢?

解决方案 »

  1.   

    TPoint是一个记录类型
    记录类型的常量应该这样定义:
    BasePoint:TPoint = (X: 449; Y: 36);
      

  2.   

    Delphi Language Reference
    Record constantsTopic Groups See Also
    ------------------------------------
    To declare a record constant, specify the value of each field--as fieldName: value, with the field assignments separated by semicolons--in parentheses at the end of the declaration. The values must be represented by constant expressions. The fields must be listed in the order in which they appear in the record type declaration, and the tag field, if there is one, must have a value specified; if the record has a variant part, only the variant selected by the tag field can be assigned values.Examples:type
      TPoint = record
        X, Y: Single;
      end;
      TVector = array[0..1] of TPoint;
      TMonth = (Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec);
      TDate = record
        D: 1..31;
        M: TMonth;
        Y: 1900..1999;
      end;
    const
      Origin: TPoint = (X: 0.0; Y: 0.0);
      Line: TVector = ((X: -3.1; Y: 1.5), (X: 5.8; Y: 3.0));
      SomeDay: TDate = (D: 2; M: Dec; Y: 1960);delphi help的例子