PA_GetFieldProperties

4D - Documentation   Français   English   German   4D Plugin API, Command Theme List   4D Plugin API, Command Alphabetical List   Back   Previous   Next

version 2003


PA_GetFieldProperties (tNum; fNum; fieldKind; stringLength; isIndexed; fAttributes)

ParameterTypeDescription
tNumshortTable number
fNumshortField number
fieldKindPA_FieldKind *Kind of field
stringLengthshort *Length of the string field
isIndexedchar *1 = Indexed field
fAttributeslong *Field attributes

Description

The routine PA_GetFieldProperties returns different information about the given field.

fieldKind is the kind of the field, a returned value from the PA_FieldKind enum, defined as this:

typedef enum
{
eFK_InvalidFieldKind= -1,
eFK_AlphaField= 0,// Alphanumeric field (from 2 to 80 characters)
eFK_RealField= 1,// Numeric field (Double or Extended value)
eFK_TextField= 2,// Text field (up to 32000 characters)
eFK_PictureField= 3,// Picture field (virtually any block of data)
eFK_DateField= 4,// Date field
eFK_BooleanField= 6,// Boolean field
eFK_SubfileField= 7,// Subfile field
eFK_IntegerField= 8,// Integer field (-32768..32767)
eFK_LongintField= 9,// Long Integer field (-2^31..(2^31)-1)
eFK_TimeField= 11,// Time field
eFK_BlobField= 30// BLOB field
} PA_FieldKind;

stringLength is the length of the field expressed in characters. It may vary from 2 to 80 characters. The length is significant only for alphanumeric fields and can be ignored for all other types of fields.

isIndexed is 1 if the field is indexed, otherwise it is 0. Note that for non-indexable fields (text, Pictures, blobs, subtables), this value can be ignored

fAttributes are the attributes of the Field (such as Mandatory), returned bit field coded on the Low Word of fAttributes.

Bit numberSet to 1 if the FieldCan be ignored if
15Is IndexedText, Picture or SubTable
14Is Indexed uniqueSubTable Boolean, Text, Picture, or if bit
15 is not set
13Is MandatorySubTable
12Is ModifiablePicture or SubTable
11Is MandatorySubTable
10Is ModifiableSubTable
8Is InvisibleSubTable
6Has an AutomaticText, Picture or SubTable
Many to One relation*
5Has an AutomaticText, Picture or SubTable
One to Many relation*
2 and 1Has an Automatic One to ManyAllow Deletion Control in the
relation* whose "Deletion Control"Preferences Dialog box is not checked,
option is:(equivalent to Leave Related Many
00 Relational Integrity databaseintact)
option is not active
01 Leave related many intact
10 Delete related many
11 Can't delete related many
0Has an automatic One to ManyText, Picture, or SubTable, or if bit 5 is
relation* whose "Auto assignnot set
related value" attribute is set

*The relation starts from this Field.

Note that the definition of a field may change during a session if the database is not compiled a user may edit field definitions in the Design environment while the 4D Extension is running in another process.

Example

Get the visible of a field

   #define kINVISIBLE_MASK      0x00000100
   
   char IsFieldVisible (short tNum, short fNum)
   {
      PA_FieldKind   kind;
      short         len;
      char         isIndexed;
      long         attrs;
      
      PA_GetFieldProperties(tNum, fNum, &kind, &len, &isIndexed, &attrs);
      if(PA_GetLastError())
         return 0; // or error code ?
      
      return (char) ( (attrs & kINVISIBLE_MASK) ? 1 : 0 );
   }

See Also

PA_GetFieldList, PA_GetFieldName, PA_GetFieldRelation.

Error Handling

Use PA_GetLastError to see if an error occurred (bad table/field numbers).


4D - Documentation   Français   English   German   4D Plugin API, Command Theme List   4D Plugin API, Command Alphabetical List   Back   Previous   Next