在使用delphi帮助的一些问题,
比如我想在delphi环境下使用getmonth函数时,查delphi帮助时有如下疑问? Delphi Object and Component Reference
GetMonth method (TXSCustomDateTime)
TXSCustomDateTime See also
------------------
Returns the value of the Month property.
Delphi syntax:
function GetMonth: Word;
C++ syntax:
Word __fastcall GetMonth(void);
Description 
GetMonth is the protected read implementation of the Month property.Q
1,
我这样写
var d:word;
begin
  d := GetMonth;
end;
提示:
Undeclared identifier: 'GetMonth'
要使用GetMonth函数要uses哪单元?此答案在delphi的帮助里在那里可以体现?
2,对于delphi里的GetMonth method (TXSCustomDateTime)
此处的TXSCustomDateTime应该是说TXSCustomDateTime类有方法GetMonth吧?var d:TXSCustomDateTime;
begin
   d:=TXSCustomDateTime.create;
   d.   //此时找不到Getmonth方法,为什么啊?
end;
3,最后是问怎样用Getmonth函数?

解决方案 »

  1.   

    var d:TXSCustomDateTime;
    begin
       d:=TXSCustomDateTime.create;//既然有提示写出来,第一个问题是多余的了.
       d.   //此时找不到Getmonth方法,为什么啊?
    end;但就是不明白为什么实例d没有方法Getmonth啊.
    TXSCustomDateTime = class(TRemotableXS)
      protected
        FDateTime: WideString;
        function GetAsDateTime: TDateTime;
        function GetAsUTCDateTime: TDateTime;
        function GetDay: Word;
    ...
      public
        property Day: Word read GetDay write SetDay default 0;
    ...
      end;
    这个意思是说Getday只能供属性day写数据时用,而在其它地方不能用的啊?