Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- The Guide To Clipper - <b>field()/fieldname()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
FIELD()/FIELDNAME()


Syntax:     FIELD(<expN>)/FIELDNAME(<expN>)

Purpose:    To return the name of a specified field in the current
            database file.

Argument:   <expN> is the ordinal position of a field in the
            database file structure.

Returns:    A character string.

            If <expN> is greater than the number of the fields in the
            current database file, FIELD() returns a null string ("").
            Fieldnames are returned all upper case.

Usage:      FIELD() accesses each fieldname using an index to the
            position of the fieldname in the database structure.  If you
            need other database file structure information, use TYPE()
            and LEN().  If you need the number of decimal places a
            numeric field has defined, use the following expression:

            LEN(SUBSTR(STR(<field>),;
               RAT(".", STR(<field>)) + 1))

            Note that AFIELDS() provides similar but expanded capability
            for obtaining field attribute information.

Library:    CLIPPER.LIB


----------------------------------- Example --------------------------------

   USE Sales
   ? FIELD(1)                 && Result: BRANCH
   ? FCOUNT()                 && Result: 5
   ? LEN(FIELD(0))            && Result: 0
   ? LEN(FIELD(40))           && Result: 0


See Also: COPY STRU EXTENDED AFIELDS() FCOUNT() LASTREC()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson