How to use a search table in Machine Link

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;

Last updated

Was this helpful?