S
S
slowkazak2015-04-10 15:45:25
Delphi
slowkazak, 2015-04-10 15:45:25

Delphi how to search through two different arrays?

Good afternoon. There is this code:

var
m : Integer;
  WorkSheet: OLEVariant;
  FData: Variant;
begin

ExcelApp.Workbooks.Open(filez.Text);
WorkSheet := ExcelApp.ActiveWorkbook.ActiveSheet;
FData := WorkSheet.UsedRange.Value;
SQLQuery.SQL.Text :='SELECT `sklad`.tovar_id FROM `sklad`';
SQLQuery.Active := true;
SQLQuery.Open;
...
SQLQuery.Close;

Can you please tell me how to find matching elements in SQLQuery as quickly as possible after its execution (SQLQuery1.FieldByName('product_id')) and FData[m, 1] (where m is a row in the array and 1 is a column) while the number of rows received in the result of SQLQUERY and FData may not be equal?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Rsa97, 2015-04-10
@Rsa97

Create another array, transfer the data from the request there, sort both arrays, go through both at the same time comparing the data.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question