Develop > Programming > System Language reference > List: rtecalls > rtecall("getprimary") function

rtecall ("getprimary") function

A RAD function that returns an array containing the primary key values for a current record. The keys can later be used to retrieve the record using the rtecall("getrecord") function. This function can only be used against tables that have a primary key. Otherwise, error code 2 is returned.

Function

rtecall("getprimary")

Format

$L.void=rtecall($L.fnc.name, $L.errcode, $L.array, $L.file)

Parameters

The following parameters are valid for the rtecall("getprimary") function:

Variable/Value Description
$L.void = true If key values are returned in $L.keyvalues. For example, if $L.file represents a current database record.
$L.void= false If no key values are returned. For example, if $L.file does not represent a current database record.
$L.errcode = 0 The function succeeded.
$L.errcode = 1 The $L.file does not represent a file variable.
$L.errcode = 2 The file identified by $L.file does not have a primary key defined.
$L.file The file variable initialized by the rinit command panel and containing a current record.

Factors

$L.keyvalues is an output variable. The output returns an array containing the primary key values for the record in $L.file. For example, if $L.file is for the problem table, an example of the key values returned in $L.keyvalues is {"IM1001",1}.

Example

$L.void = rtecall( "getprimary", $L.errcode, $L.keyvalues, $L.file )