Get the Item for a Tag
Posted: Sat Sep 24, 2005 6:48 pm
Hello
I have a Tag-Value (Id) and want to find the Item for it.
I use the following procdure to get it.
My Question is, is there a faster way than to iterate throuh
the items ?
Thanks Calivers
I have a Tag-Value (Id) and want to find the Item for it.
I use the following procdure to get it.
My Question is, is there a faster way than to iterate throuh
the items ?
Code: Select all
function GetItemNum(Id: Integer): Integer;
var
i: Integer;
begin
Result := -1;
if RV.GetCurrentTag = Id then
begin
Result := RV.CurItemNo;
end else begin
for i := 0 to RV.ItemCount - 1 do
begin
if RV.GetItemTag(i) = Id then
begin
Result := i;
Exit;
end;
end;
end;
end;