Returns attribute information about specified field.
Syntax
intl DlFieldGetAttribute (DlFieldId hfield, DlAttribute
which, char *buffer, intl bufSize)
Arguments
hfield
Handle to field object, as returned by DlFieldGet. Identifies the field for which attribute information is to be returned. Input
which
The specific attribute to return. Input.
Field Attribute Enum | Description |
---|---|
DlName | Field name |
DlFieldname | Field name as it appears in .DLD file |
DlWidth | Field width |
DlDecimals | Number of decimal places, if numeric |
DlPrice | Not implemented |
DlLicenseType | Not implemented |
DlLicenseStatus | Not implemented |
DlDescription | Short (32 character) description of field |
DlHelp | Long (256 character) description of field |
DlNumvalues | Number of unique values possible for field |
DlType | Field type; "N" (numeric) or "C" (character) |
*buffer
Location to store the returned data. Output
bufSize
Maximum size of data to return in buffer. Input
Return Value
Returns attribute information for specified field.
Notes
DlFieldGetAttribute is used to retrieve attribute information about a specified field within a .DLD file. This may include such information as field name and description, field size, and data types.
See Also
DlFieldGet, DlFieldGet, DlFieldGetValueAttribute
Example
See DlFieldGetN for an additional example.
// This code fragment "walks" through the data file, fetches each field's name,
// and prints it to both screen and buffer.
intl NumFields = DlFileNumFields(hFile);
if (NumFields<=0)
return;
fields = new DlFieldId[NumFields];
for (intl counter=0; counter < NumFields; counter++)
{
fields[counter] = DlFieldGetN(hFile, counter);
if (fields[counter] == 0)
{
delete[ ]fields;
return;
}
if(!DlFieldGetAttribute(fields [counter], DlName, string, 256) && string != "")
{
/* insert error-handling routines here */
}
else
{
sprintf(output, "Name: %s\n", string);
printf(output);
}
}