初学Delphi, 求高手教我if-else用法.(我攻ASP.net的,所以结构上有点不懂)
procedure TProjectForm.btnYesClick(Sender: TObject);begin
if StrToInt(cbStage.Items.Text) in [010,020,030,110] then
qryStage.Close;
qryStage.SQL.Clear;
qryStage.SQL.Add('select * from DStageDetail where Stage='''+cbStage.Text+'''');
qryStage.SQL.Add(' and outputdate >= '+formatdatetime('yyyymmdd',dtpSta.Date) );
qryStage.SQL.Add(' and outputdate <= '+formatdatetime('yyyymmdd',dtpOver.Date) );
qryStage.Open;
else
qryStage.Close;
qryStage.SQL.Clear;
qryStage.SQL.Add('select * from DFQCDetail where Stage='''+cbStage.Text+'''');
qryStage.SQL.Add(' and outputdate >= '+formatdatetime('yyyymmdd',dtpSta.Date) );
qryStage.SQL.Add(' and outputdate <= '+formatdatetime('yyyymmdd',dtpOver.Date) );
qryStage.Open;
end
begin
end;
-------我是分割线--------
在网上有看一点资料.对于这个begin的概念似乎有点模糊.再就是对于if-else说跟的条件结构也有点模糊.求好心人指点指点.(注:现工作需要)