# 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;
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.calwincloud.com/calwin-script/machine-link/how-to-use-a-search-table-in-machine-link.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
