CLEAR
SET TALK OFF
ERASE
USE ANA12759
DO WHILE .NOT. EOF
STORE 65 TO WHATCHAR
REPLACE WORD WITH !(WORD)
STORE WORD TO NEWWORD
STORE LEN(TRIM(WORD)) TO LENGTH
STORE ' ' TO MKEY
? 'VARIABLES LOADED'
DO WHILE WHATCHAR < 91
DO WHILE LENGTH > 0
DO CASE
CASE @(CHR(WHATCHAR),NEWWORD)
STORE (@(CHR(WHATCHAR),NEWWORD)+1) TO POINTER
STORE MKEY+CHR(WHATCHAR) TO MKEY
	IF POINTER > LENGTH
	STORE 0 TO LENGTH
	ELSE
	STORE LENGTH - (POINTER-1) TO LENGTH
	STORE $(NEWWORD,POINTER) TO NEWWORD
	ENDIF
CASE @(CHR(WHATCHAR),NEWWORD)=0
STORE 0 TO LENGTH
CASE LEN(TRIM(WORD))=LEN(MKEY-1)
STORE 0 TO LENGTH
STORE 91 TO WHATCHAR
ENDCASE
ENDDO
STORE WHATCHAR + 1 TO WHATCHAR
STORE TRIM(WORD) TO NEWWORD
STORE LEN(TRIM(WORD)) TO LENGTH
ENDDO
? 'RECORD NUMBER ',#
? 'MKEY IS ',MKEY
REPLACE KEY WITH $(MKEY,2)
SKIP
ENDDO
SET TALK ON
CLEAR
RETURN
