首页 > 代码库 > delphi array应用 DayOfWeek星期几判断

delphi array应用 DayOfWeek星期几判断

//array应用 DayOfWeek星期几判断 
procedure TForm1.Button1Click(Sender: TObject);
var
    days:array[1..7] of string;
    todayIs:string;
begin
    days[1] := ‘日 ‘;
    days[2] := ‘一 ‘;
    days[3] := ‘二 ‘;
    days[4] := ‘三 ‘;
    days[5] := ‘四 ‘;
    days[6] := ‘五 ‘;
    days[7] := ‘六 ‘;
    todayIs := ‘星期 ‘+days[DayOfWeek(Now)];
    showMessage(todayIs);
end;


来自为知笔记(Wiz)