Y
yedixifeng
Unregistered / Unconfirmed
GUEST, unregistred user!
运行时出现undeclared indentifier:'values',不知道问题出在哪,请指教。代码如下:procedure TfrmDlgSQFind.ClickOK;begin FWhlSql := 'a.ValidDate between ' +''''+FormatDateTime('yyyy-mm-dd',edtBeginDate.Date)+'''' +' and '+''''+FormatDateTime('yyyy-mm-dd',edtEndDate.Date)+' 23:59:59'+''''; if edtCustomerID.ItemIndex > 0 then begin FWhlSql := FWhlSql+' and a.CustomerID='+'''' +edtCustomerID.Values.Strings[edtCustomerID.ItemIndex]+''''; end; if Trim(edtMtext.Text) <> '' then begin FWhlSql := FWhlSql+' and a.Mtext like '+''''+'%'+Trim(edtMtext.Text)+'%'+''''; end; inherited; end;procedure TfrmDlgSQFind.SetCustomerItems;var Sql: string;begin Sql := 'select CustomerID,CustomerName,ShortName' +' from BasCustomer' +' where Status=1'; if G_JYStyle in [4,5,6,9] then begin Sql := Sql + ' and 1=1'; end else begin Sql := Sql + ' and 1=2'; end; Sql := Sql+' order by CustomerID'; G_OpenSQL(Sql,ads); with ads,edtCustomerID do begin Items.Clear; Values.Clear; Items.Add('全部'); Values.Add(''); First; while not Eof do begin Items.Add(FieldByName('ShortName').AsString); Values.Add(FieldByName('CustomerID').AsString); Next; end; ItemIndex := 0; end;end;procedure TfrmDlgSQFind.btnSelectCustomerClick(Sender: TObject);var CustomerID: string;begin inherited; CustomerID := frmMain.SelectCustomer; if Trim(CustomerID) = '' then exit; edtCustomerID.ItemIndex := edtCustomerID.Values.IndexOf(CustomerID);end;