?? edit.~pas
字號:
edit9.Text:='';
edit8.Text:=treeview1.Selected.Text;
exit;
end;
try
w6:=treeview1.Selected.Parent.Parent.Parent.Parent.Parent.Parent.Text;
except
edit5.Text:='';
edit6.Text:='';
edit7.Text:='';
edit8.Text:='';
edit9.Text:=treeview1.Selected.Text;
exit;
end;
end;
procedure TForm9.TreeView2Click(Sender: TObject);
var
q1,q2,q3,q4,q5,q6:string;
begin
edit3.Text:=treeview2.Selected.Text;
try
q1:=treeview2.Selected.Parent.Text;
except
edit10.Text:='';
edit11.Text:='';
edit12.Text:='';
edit13.Text:='';
edit14.Text:='';
edit3.Text:=treeview2.Selected.Text;
exit;
end;
try
q2:=treeview2.Selected.Parent.Parent.Text;
except
edit11.Text:='';
edit12.Text:='';
edit13.Text:='';
edit14.Text:='';
edit10.Text:=treeview2.Selected.Text;
exit;
end;
try
q3:=treeview2.Selected.Parent.Parent.Parent.Text;
except
edit10.Text:='';
edit12.Text:='';
edit13.Text:='';
edit14.Text:='';
edit11.Text:=treeview2.Selected.Text;
exit;
end;
try
q4:=treeview2.Selected.Parent.Parent.Parent.Parent.Text;
except
edit10.Text:='';
edit11.Text:='';
edit13.Text:='';
edit14.Text:='';
edit12.Text:=treeview2.Selected.Text;
exit;
end;
try
q5:=treeview2.Selected.Parent.Parent.Parent.Parent.Parent.Text;
except
edit10.Text:='';
edit11.Text:='';
edit12.Text:='';
edit14.Text:='';
edit13.Text:=treeview2.Selected.Text;
exit;
end;
try
q6:=treeview2.Selected.Parent.Parent.Parent.Parent.Parent.Parent.Text;
except
edit10.Text:='';
edit12.Text:='';
edit13.Text:='';
edit11.Text:='';
edit14.Text:=treeview2.Selected.Text;
exit;
end;
end;
procedure TForm9.FormCreate(Sender: TObject);
begin
currentdir:=getcurrentdir;
end;
procedure TForm9.Image3MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
image2.Visible:=true;
image3.Visible:=false;
end;
procedure TForm9.Image1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
image3.Visible:=true;
image2.Visible:=false;
end;
procedure TForm9.Image2Click(Sender: TObject);
var
s1,s2,s3,s4,s5,s:string;
usenode,usenode1:ttreenode;
tongji:integer;
begin
adodataset5.Filtered:=false;
adodataset5.Active:=false;
adodataset5.CommandText:='select * from total';
adodataset5.Active:=true;
//關鍵詞查詢
if trim(edit1.Text)<>'' then
begin
s:=edit1.Text;
//截取關鍵詞
if trim(s)<>'' then
begin
if ansipos(' ',trim(s))<>0 then
begin
s1:=leftstr(trim(s),ansipos(' ',trim(s)) - 1);
s:=rightstr(trim(s),strlen(pchar(trim(s))) - ansipos(' ',trim(s)));
tongji:=1;
end
else
begin
s1:=s;
tongji:=1;
end;
end ;
if trim(s)<>'' then
begin
if ansipos(' ',trim(s))<>0 then
begin
s2:=leftstr(trim(s),ansipos(' ',trim(s)) - 1);
s:=rightstr(trim(s),strlen(pchar(trim(s))) - ansipos(' ',trim(s)));
tongji:=2;
end
else
begin
s2:=s;
s:='';
tongji:=2;
end;
end ;
if trim(s)<>'' then
begin
if ansipos(' ',trim(s))<>0 then
begin
s3:=leftstr(trim(s),ansipos(' ',trim(s)) - 1);
s:=rightstr(trim(s),strlen(pchar(trim(s))) - ansipos(' ',trim(s)));
tongji:=3;
end
else
begin
s3:=s;
s:='';
tongji:=3;
end;
end ;
if trim(s)<>'' then
begin
if ansipos(' ',trim(s))<>0 then
begin
s4:=leftstr(trim(s),ansipos(' ',trim(s)) - 1);
s:=rightstr(trim(s),strlen(pchar(trim(s))) - ansipos(' ',trim(s)));
tongji:=4;
end
else
begin
s4:=s;
s:='';
tongji:=4;
end;
end ;
if trim(s)<>'' then
begin
if ansipos(' ',trim(s))<>0 then
begin
s5:=leftstr(trim(s),ansipos(' ',trim(s)) - 1);
s:=rightstr(trim(s),strlen(pchar(trim(s))) - ansipos(' ',trim(s)));
tongji:=5;
end
else
begin
s5:=s;
s:='';
tongji:=5;
end;
end ;
//開始搜索
if tongji=1 then
begin
adodataset5.Active:=false;
adodataset5.CommandText:='select * from total where filename like '+''''+'%'+s1+'%'+'''';
adodataset5.Active:=true;
end;
if tongji=2 then
begin
adodataset5.Active:=false;
adodataset5.CommandText:='select * from total where filename like '+''''+'%'+s1+'%'+''''+ ' and filename like '+''''+'%'+s2+'%'+'''';
adodataset5.Active:=true;
end;
if tongji=3 then
begin
adodataset5.Active:=false;
adodataset5.CommandText:='select * from total where filename like '+''''+'%'+s1+'%'+''''+ ' and filename like '+''''+'%'+s2+'%'+''''+ ' and filename like '+''''+'%'+s3+'%'+'''';
adodataset5.Active:=true;
end;
if tongji=4 then
begin
adodataset5.Active:=false;
adodataset5.CommandText:='select * from total where filename like '+''''+'%'+s1+'%'+''''+ ' and filename like '+''''+'%'+s2+'%'+''''+ ' and filename like '+''''+'%'+s3+'%'+''''+ ' and filename like '+''''+'%'+s4+'%'+'''';
adodataset5.Active:=true;
end;
if tongji=5 then
begin
adodataset5.Active:=false;
adodataset5.CommandText:='select * from total where filename like '+''''+'%'+s1+'%'+''''+ ' and filename like '+''''+'%'+s2+'%'+''''+ ' and filename like '+''''+'%'+s3+'%'+''''+ ' and filename like '+''''+'%'+s4+'%'+''''+ ' and filename like '+''''+'%'+s5+'%'+'''';
adodataset5.Active:=true;
end;
end
else if trim(edit1.Text)='' then
begin
if trim(edit2.Text)='根' then //點擊樹‘根’時處理命令
begin
showmessage('請選擇主題詞為條件進行查詢!');
exit;
end;
if trim(edit5.Text)<>'' then //1
begin //(1-1)
edit4.Text:='';
adodataset5.Active:=false;
adodataset5.CommandText:='select * from total where zhutc like '+''''+'%'+edit5.text+'%'+'''';
adodataset5.Active:=true;
end;
if trim(edit6.Text)<>'' then //2
begin
edit4.Text:='';
adodataset5.Active:=false;
adodataset5.CommandText:='select * from total where zhutc like '+''''+'%'+edit6.text+'%'+'''';
adodataset5.Active:=true;
end;
if trim(edit7.Text)<>'' then //3
begin //(1-3)
edit4.Text:='';
adodataset5.Active:=false;
adodataset5.CommandText:='select * from total where zhutc like '+''''+'%'+edit7.text+'%'+'''';
adodataset5.Active:=true;
end;
if trim(edit8.Text)<>'' then //4
begin //(1-4)
edit4.Text:='';
adodataset5.Active:=false;
adodataset5.CommandText:='select * from total where zhutc like '+''''+'%'+edit8.text+'%'+'''';
adodataset5.Active:=true;
end;
if trim(edit9.Text)<>'' then //5
begin //(1-5)
edit4.Text:='';
adodataset5.Active:=false;
adodataset5.CommandText:='select * from total where zhutc like '+''''+'%'+edit9.text+'%'+'''';
adodataset5.Active:=true;
end; //(1-5)
//以部門為檢索條件
if trim(edit10.Text)<>'' then //1
begin
edit4.Text:='';
adodataset5.Active:=false;
adodataset5.CommandText:='select * from total where department like '+''''+'%'+edit10.text+'%'+'''';
adodataset5.Active:=true;
end;
if trim(edit11.Text)<>'' then //2
begin
edit4.Text:='';
adodataset5.Active:=false;
adodataset5.CommandText:='select * from total where department like '+''''+'%'+edit11.text+'%'+'''';
adodataset5.Active:=true;
end; //3
if trim(edit12.Text)<>'' then
begin
edit4.Text:='';
adodataset5.Active:=false;
adodataset5.CommandText:='select * from total where department like '+''''+'%'+edit12.text+'%'+'''';
adodataset5.Active:=true;
end;
if trim(edit13.Text)<>'' then //4
begin
edit4.Text:='';
adodataset5.Active:=false;
adodataset5.CommandText:='select * from total where department like '+''''+'%'+edit13.text+'%'+'''';
adodataset5.Active:=true;
end;
if trim(edit14.Text)<>'' then //5
begin
edit4.Text:='';
adodataset5.Active:=false;
adodataset5.CommandText:='select * from total where department like '+''''+'%'+edit14.text+'%'+'''';
adodataset5.Active:=true;
end;
if trim(combobox1.Text)<>'' then
begin
edit4.Text:='';
adodataset5.Active:=false;
adodataset5.CommandText:='select * from total where filetype like '+''''+'%'+combobox1.Text+'%'+'''';
adodataset5.Active:=true;
end;
if trim(edit4.text)<>''then //以時間為查詢條件
begin
adodataset5.Filter:='time>='''+edit4.Text+'''';
adodataset5.Filtered:=true;
adodataset5.Open;
end;
end;
edit1.Text:='';
edit2.Text:='';
edit3.Text:='';
edit4.Text:='';
edit5.Text:='';
edit6.Text:='';
edit7.Text:='';
edit8.Text:='';
edit9.Text:='';
edit10.Text:='';
edit11.Text:='';
edit12.Text:='';
edit13.Text:='';
edit14.Text:='';
combobox1.Text:='';
usenode:=treeview1.Items.GetFirstNode;
usenode.Collapse(true);
usenode1:=treeview2.Items.GetFirstNode;
usenode1.Collapse(true);
edit1.SetFocus;
form10.showmodal;
image3.Visible:=true;
image2.Visible:=false;
end;
end.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -