Retrieving information about a specified data dictionary fieldΒΆ

FieldProp()

Retrieve information about a specified data dictionary field


SYNTAX

FieldProp(pathname, fieldnum, propnames, propvalues)

Retrieve information about a specified data dictionary field.

pathname

The path of the data dictionary (.d) file to be read.

fieldnum

An integer value representing the number of the field (starting from 1, the first key field).

propnames

Alphanumeric array of DOTD_NUMPROP (14) elements. The array is filled with the property names - briefer versions of the descriptions listed below. This argument may be NULL.

propvalues

Alphanumeric array of DOTD_NUMPROP (14) elements. The array is filled with the property values. This argument may be NULL, though this is not recommended. Only elements 1-13 are applicable to fields retrieved by this function (main index fields). The values returned are:

1

The field name

2

type, e.g. a = alphanumeric, i = integer

3

size in bytes

4

number of dimensions

5

heading

6

format string

7

help text

8

hide from Sculptor SQL (0=false, 1=true)

9

comment text

10

key field (0=false, 1=true)

11

logical type

12

reverse field sign for Sculptor SQL (0=false, 1=true)

13

validation string

14

element (secondary index fields only)

The function returns 0 if the arrays are successfully filled, or -1 if sent the wrong number of arguments. If an out of range field number is provided, the function returns 0 but stores nothing in the arrays.


NOTES

  • The OpenDotd() function returns general information about a data dictionary. OpenIndex() returns general information about a specified secondary index, and IndexFieldProp() returns properties of a specified field in a secondary index.

  • If the propnames or propvalues array is dimensioned to less than DOTD_NUMPROP, the function fills the elements available. If the dimension is greater, the excess elements are ignored.

  • DOTD_NUMPROP is defined in <sculptor.h>.


EXAMPLE

!temp PropArray,,a255[DOTD_NUMPROP]

!function GetFieldProps(Path) {
!temp Loop,,i2

     for (Loop = 1;Loop <= tmp.NumDDFields; Loop ++) {

          if (FieldProp(Path, Loop, NULL, PropArray) <> 0) {
               error "Error retrieving data for field " + tostr(Loop)
               break
          }
          ...
     }

RELATED TOPICS

OpenDotd()

OpenIndex()

IndexFieldProp()

Data dictionaries

Data fields