* Add routine LOCAL lcAlias, liKey lcAlias = ALIAS() SELECT TheTable LOCATE FOR DELETED IF FOUND() liKey = PrimaryKey SCATTER MEMVAR MEMO BLANK GATHER MEMVAR MEMO REPLACE PrimaryKey WITH liKey ELSE APPEND BLANK ENDIF IF NOT EMPTY( lcAlias ) SELECT ( lcAlias ) ELSE SELECT 0 ENDIF