不好意思,想請問一下Outlook的工作檢視要如何寫?? |
|
y2464372001
一般會員 發表:6 回覆:7 積分:2 註冊:2007-01-23 發送簡訊給我 |
我已經完成了每日排程,剩下每週、每月及每年~~
每週是要如果寫???例如2007年1月的星期一裡的天數,如果有是當天的日期就抓取出來(可是我寫出來的不能跑)
procedure TForm1.DaysOfWeek(Year: Integer; Month: Integer; Week: Integer); var W : String ; begin Form4.Calendar1.Year := Year; Form4.Calendar1.Month := Month; if W ='星期日' then Form4.ListBox4.Items.Add(Form4.Calendar1.CellText[0,week]); if W ='星期一' then Form4.ListBox4.Items.Add(Form4.Calendar1.CellText[1,week]); if W ='星期二' then Form4.ListBox4.Items.Add(Form4.Calendar1.CellText[2,week]); if W ='星期三' then Form4.ListBox4.Items.Add(Form4.Calendar1.CellText[3,week]); if W ='星期四' then Form4.ListBox4.Items.Add(Form4.Calendar1.CellText[4,week]); if W ='星期五' then Form4.ListBox4.Items.Add(Form4.Calendar1.CellText[5,week]); if W ='星期六' then Form4.ListBox4.Items.Add(Form4.Calendar1.CellText[6,week]); end; 每日的排程是 var n,s,r: string; a,b,j,x,y,m,d: integer; dt : TDate; Match : Boolean; begin case sRadioGroup1.ItemIndex of 0:begin StringGrid6.RowCount :=x; dt :=Form4.Calendar1.Day; Form4.ADOTable3.First; x :=1; while not Form4.ADOTable3.Eof do begin for a:= 1 to Form4.ADOTable3.RecordCount do begin s := Form4.ADOTable3.Fields[1].AsString; Match := False; for j:= 1 to 6 do begin StringGrid6.Cells[j,x] := Form4.ADOTable3.Fields[j].AsString; if s = '每日' then begin n := Form4.ADOTable3.Fields[0].AsString; Match := True; Form4.ADOTable1.First; while not Form4.ADOTable1.Eof do begin if Form4.ADOTable1.Fields[0].AsString = n then begin StringGrid6.Cells[0,x] := Form4.ADOTable1.Fields[1].AsString; end; Form4.ADOTable1.Next; end; end; if s = '每週' then begin end; if s = '每月' then begin end; if s = '每年' then begin end; end; end; if Match then Inc(x); if not Form4.ADOTable3.Eof then Form4.ADOTable3.Next; end; end; | ||||||||||||||||||||||||||||||||||||||||||||||
coa
一般會員 發表:1 回覆:16 積分:13 註冊:2004-07-18 發送簡訊給我 |
您好:
請參考看看是不是下面的問題 ===================引 用 文 章=================== 我已經完成了每日排程,剩下每週、每月及每年~~ 每週是要如果寫???例如2007年1月的星期一裡的天數,如果有是當天的日期就抓取出來(可是我寫出來的不能跑) //這一段我試是OK沒問題的... procedure TForm1.DaysOfWeek(Year: Integer; Month: Integer; Week: Integer); var W : String ; begin ? Form4.Calendar1.Year := Year; ? Form4.Calendar1.Month := Month; ? if W ='星期日' then Form4.ListBox4.Items.Add(Form4.Calendar1.CellText[0,week]); ? if W ='星期一' then Form4.ListBox4.Items.Add(Form4.Calendar1.CellText[1,week]); ? if W ='星期二' then Form4.ListBox4.Items.Add(Form4.Calendar1.CellText[2,week]); ? if W ='星期三' then Form4.ListBox4.Items.Add(Form4.Calendar1.CellText[3,week]); ? if W ='星期四' then Form4.ListBox4.Items.Add(Form4.Calendar1.CellText[4,week]); ? if W ='星期五' then Form4.ListBox4.Items.Add(Form4.Calendar1.CellText[5,week]); ? if W ='星期六' then Form4.ListBox4.Items.Add(Form4.Calendar1.CellText[6,week]); ?end; 每日的排程是 var n,s,r: string; ??? a,b,j,x,y,m,d: integer; ??? dt : TDate; ??? Match : Boolean; begin ? case sRadioGroup1.ItemIndex of ? 0:begin ??? StringGrid6.RowCount :=x; ??? dt :=Form4.Calendar1.Day; ??? Form4.ADOTable3.First; ??? x :=1; ??? while not Form4.ADOTable3.Eof do begin ????? for a:= 1 to Form4.ADOTable3.RecordCount do begin ????? s := Form4.ADOTable3.Fields[1].AsString; ????? Match := False; ??????? for j:= 1 to 6 do begin ????????? StringGrid6.Cells[j,x] := Form4.ADOTable3.Fields[j].AsString; ??????????? if s = '每日' then begin ????????????? n := Form4.ADOTable3.Fields[0].AsString; ????????????? Match := True; ????????????? Form4.ADOTable1.First; ????????????? while not Form4.ADOTable1.Eof do begin ??????????????? if Form4.ADOTable1.Fields[0].AsString = n then begin ????????????????? StringGrid6.Cells[0,x] := Form4.ADOTable1.Fields[1].AsString; ??????????????? end; ??????????????? Form4.ADOTable1.Next; ????????????? end; ??????????? end; ??????????? if s = '每週' then begin // 是不是應該要 Call DaysOfWeek? ??????????? end; ??????????? if s = '每月' then begin // 同上,是不是應該在這邊寫 code 或是寫一個 procedure/function 處裡你要的結果並呼叫? ??????????? end; ??????????? if s = '每年' then begin // 同上 ??????????? end; ??????? end; ????? end; ??? if Match then Inc(x); ??? if not Form4.ADOTable3.Eof then ??? Form4.ADOTable3.Next; ??? end; ??? ??? end; |
||||||||||||||||||||||||||||||||||||||||||||||
y2464372001
一般會員 發表:6 回覆:7 積分:2 註冊:2007-01-23 發送簡訊給我 |
|||||||||||||||||||||||||||||||||||||||||||||||
coa
一般會員 發表:1 回覆:16 積分:13 註冊:2004-07-18 發送簡訊給我 |
Sorry, 漏看了一處...
procedure TForm1.DaysOfWeek(Year: Integer; Month: Integer; Week: Integer); var W : String ; begin ? Form4.Calendar1.Year := Year; ? Form4.Calendar1.Month := Month; // 變數 W 你沒給值... ? if W ='星期日' then Form4.ListBox4.Items.Add(Form4.Calendar1.CellText[0,week]); ? if W ='星期一' then Form4.ListBox4.Items.Add(Form4.Calendar1.CellText[1,week]); ? if W ='星期二' then Form4.ListBox4.Items.Add(Form4.Calendar1.CellText[2,week]); ? if W ='星期三' then Form4.ListBox4.Items.Add(Form4.Calendar1.CellText[3,week]); ? if W ='星期四' then Form4.ListBox4.Items.Add(Form4.Calendar1.CellText[4,week]); ? if W ='星期五' then Form4.ListBox4.Items.Add(Form4.Calendar1.CellText[5,week]); ? if W ='星期六' then Form4.ListBox4.Items.Add(Form4.Calendar1.CellText[6,week]); ?end; ===================引 用 文 章=================== 恩!! 可是我寫的怪怪的執行後,沒有結果 |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |