Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2015-12

Replacement for deprecated symbol "Lookup"

3 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Juha Manninen

I try to clean out warnings from LCL. How to solve these?

Compile package LCLBase 1.7: Success, Warnings: 6
dbctrls.pp(1422,56) Warning: Symbol "Lookup" is deprecated
dbgrids.pas(1233,20) Warning: Symbol "Lookup" is deprecated
dbgrids.pas(3270,54) Warning: Symbol "Lookup" is deprecated
dbgrids.pas(3291,28) Warning: Symbol "Lookup" is deprecated
dbgrids.pas(4026,30) Warning: Symbol "Lookup" is deprecated

Regards,
Juha

Michael Van Canneyt
to Juha Manninen
Juha Manninen wrote 8 lines
I try to clean out warnings from LCL. How to solve these? Compile package LCLBase 1.7: Success, Warnings: 6 dbctrls.pp(1422,56) Warning: Symbol "Lookup" is deprecated dbgrids.pas(1233,20) Warning: Symbol "Lookup" is deprecated dbgrids.pas(3270,54) Warning: Symbol "Lookup" is deprecated dbgrids.pas(3291,28) Warning: Symbol "Lookup" is deprecated dbgrids.pas(4026,30) Warning: Symbol "Lookup" is deprecated

Use Locate instead.

Michael.

Juha Manninen
to Michael Van Canneyt
Michael Van Canneyt wrote
Use Locate instead.

They are actually TField.Lookup properties. TField does not have Locate. All the "deprecated" warnings come from Lookup getters which is implemented as :

function TField.GetLookup: Boolean;
begin
  Result := FieldKind = fkLookup;
end;

Maybe I just use "FieldKind = fkLookup". Easy piecy. Unfortunately there is no hint message after the "deprecated" keyword saying like "Use xxx instead". Such hints were not supported by FPC a while ago.

Juha