Navigation: ABC Library Reference > FileManager > FileManager Methods >====== GetComponents (return the number of key components) ====== | |
GetComponents( key )
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