> For the complete documentation index, see [llms.txt](https://docs.calwincloud.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.calwincloud.com/calwin-script/machine-link/how-to-use-a-search-table-in-machine-link.md).

# How to use a search table in Machine Link

```objectpascal
var
  gDeler: TSearchTable; // Declare a gobale variable

procedure Initialize;
begin
  // The global variable has to created and initialized in the Initiliaze procedure
  gDeler := TSearchTable.Create('ALU_DELER'); // Create and load search table "ALU_DELER"
end;

procedure Finalize;
begin
  gDeler.Free; // The global variable has to be freed
end;

function PreParseMain_Detail(aPartTable, aWorkTable: TcmlTable):boolean;
begin
  // Try to find a record in the search table
  // If the search table has more than one search column, add
  // those inside the []
  if gDeler.Find([aPartTable.FieldbyName('Elementid').AsString]) then
  begin 
    ..
  end;
  Result := true;
end;
```
