You can use the ATAGINFO(), TAG() and PRIMARY() functions to determinate what's your Primary Key index. From the Help of Primary():
CLOSE DATABASES
SET PATH TO (HOME(2) + 'Data\') && Sets path to database
OPEN DATABASE testdata && Open testdata database
USE Customer && Open customer table
FOR nCount = 1 TO 254
IF !EMPTY(TAG(nCount)) && Checks for tags in the index
? TAG(nCount) && Display tag name
? PRIMARY(nCount) && Display primary status
ELSE
EXIT && Exit the loop when no more tags are found
ENDIF
ENDFOR
HTH