RYOKeyAdd

<< Click to Display Table of Contents >>

Navigation:  Apollo VCL Components > Apollo VCL Component Reference > TApolloTable > TApolloTable Methods >

RYOKeyAdd

Declaration

function RYOKeyAdd ( sTagName, sKeyValue : String ) : WordBool;

Description

Adds a key to an existing sxChar RYO index tag that points to the current table record. Any existing key for the record is dropped. SxChar RYO indexes are limited to the FoxPro (ttSXFOX) and HiPer-SIx (ttSXNSX) drivers.

Parameters

sTagName: The name of the index tag containing the sxChar index. If passed as NULL, the current tag is used.

sKeyValue: A character string of the defined sxChar length.

Return Value

True or False depending on the outcome of the operation.

Delphi Example

with ApTbl do

begin

 Open; 

 // Create an RYO index tag that accepts any 3-byte key value

 IndexTag( '', 'CUST_CODE', 'sxChar(3)', IDX_EMPTY, False, '' ); 

 SetOrder( 0 ); 

 GoTop; 

 

 // Add a key for the current record

 if RYOKeyAdd( 'CUST_CODE', 'VIP' ) then

         ShowMessage( 'VIP Customer Code Key added successfully.' ) 

 else 

         ShowMessage( 'Key add failed!' ); 

end;

See Also

RYOKeyDrop, KeyAdd, sxChar xBase function