LlPrintIsFieldUsed

Syntax:

INT LlPrintIsFieldUsed (HLLJOB hJob, LPCTSTR lpszFieldName);

Task:

Specifies whether the given field from the loaded project is used in one of the expressions or conditions of the project. To query the used fields even before starting a print job, the usage of LlGetUsedIdentifiers is preferable.

Parameter:

hJob: List & Label job handle

lpszFieldName: Field name

Return Value:

Value

Meaning

1

Field is used

0

Field is not used

LL_­ERR_­UNKNOWN

Field is not defined

 

A valid value is greater than 0. If the value is less than 0, it shows an errorcode. Please see chapters General Notes About the Return Value and Error Codes for further details.

Hints:

This function can only be called after LlPrintStart() or LlPrintWithBoxStart().

This function needs LL_OPTION_NEWEXPRESSIONS to be set to true (default).

As calling LlDefineFieldStart() clears the "used" flags, this function will return LL_ERR_UNKNOWN or 0 afterwards, regardless of whether the field is actually used or not. Therefore do not use LlDefineFieldStart() after LlPrint[WithBox]Start().

Instead of using a specific field name, wildcards can be used. This is especially useful if you pass your fields ordered hierarchically, e.g. all fields from the "Article" table use "Article." as prefix. Simply do a search for "Article.*" to find out whether the table has been used at all by the user.

Example:

if (LlPrintIsFieldUsed(hJob, "Name") == 1)
   LlDefineFieldExt(hJob, "Name", <...>);

See also:

LlPrintStart, LlPrintWithBoxStart, LlPrintIsVariableUsed