PgDAC

TCustomDADataSet.MacroByName Method

Finds a macro with the specified name.

Class

TCustomDADataSet

Syntax

function MacroByName(const Value: string): TMacro;

Parameters
Value
Holds the name of a macro to search for.
Return Value
TMacro object if a match is found.

Remarks

Call the MacroByName method to find a macro with the specified name. If a match is found, MacroByName returns the macro. Otherwise, an exception is raised. Use this method instead of a direct reference to the TMacros.Items property to avoid depending on the order of the items.

To locate a parameter by name without raising an exception if the parameter is not found, use the FindMacro method.

To set a value to a macro, use the TMacro.Value property.

Example

PgQuery.SQL:= 'SELECT * FROM Scott.Dept ORDER BY &Order';
PgQuery.MacroByName('Order').Value:= 'DeptNo';
PgQuery.Open; 

See Also

© 1997-2020 Devart. All Rights Reserved. Request Support DAC Forum Provide Feedback