User Tools

Site Tools


getcomponents_return_the_number_of_key_components_.htm
Navigation:  ABC Library Reference > FileManager > FileManager Methods >====== GetComponents (return the number of key components) C6H0009.jpg ====== Previous pageReturn to chapter overviewNext page

GetComponents( key )

blk2blue.jpg

GetComponents Returns the number of components in the specified key.
key The label of the KEY.

The GetComponents method returns the number of components in the specified key.

Return Data Type:     BYTE

Example:

PROGRAM

INCLUDE('ABFILE.INC')             !declare FileManager

MAP                               !program map

END

GlobalErrors ErrorClass            !declare GlobalErrors objec

Access:Order CLASS(FileManager)    !derive Access:Order object

       END

I       BYTE

Order     FILE,DRIVER('TOPSPEED'),PRE(ORD),THREAD    !declare order file

IDKey      KEY(Ord:Cust,Ord:ID,Ord:Date),NOCASE,OPT,PRIMARY

Record     RECORD,PRE()

Cust       LONG

ID        LONG

Date       LONG

      . .

KeyQueue  QUEUE,PRE(KeyQ)          !a list of key components

Field     ANY                      !component field reference

FieldName   STRING(12)             !component field name

     END

CODE

!program code

LOOP Access:Order.GetComponents( ORD:IDKey ) TIMES !step thru key components

 I += 1                           !increment counter

 KeyQ.Field    = Access:Order.GetField(ORD:IDKey,I)!get component reference

 KeyQ.FieldName  = Access:Order.GetFieldName(ORD:IDKey,I)!get component name

END

getcomponents_return_the_number_of_key_components_.htm.txt · Last modified: 2021/04/15 15:57 by 127.0.0.1