本文整理自网络,侵删。
声明:const MonthDays : array [Boolean] of TDayTable =
((31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31),
(31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31));
描述:MonthDays常量是SysUtils单元中比较有用的部分,它给出了一个月有多少天。如果一个闰年(第一个数组参数Boolean为True)的2月分,它返回29。
begin
// 2000年2月份有多少天?
ShowMessage('Days in February 2000 = '+
IntToStr(MonthDays[IsLeapYear(2000)][2]));
end;
程序运行结果: Days in February 2000 = 29
相关阅读 >>
Delphi net.httpclient用最精简的代码获取网页数据
Delphi fdconnection取得excel工作表名
Delphi webbrowser1 execwb 复制 新建 打开
更多相关阅读请进入《Delphi》频道 >>