;Example of bdbfs plugin file.
;Set relation to second area

#include clipper.ch

LOCAL RelationKey
#BREAK !FileExist("child.DBF")

cCodePage:='cp866'
SELECT 2
USE HERE child
SET ORDER TO 1

SELECT 1
SET RELATION TO num
//always into area 2
GO TOP

IF EMPTY(DBRelation(1))
	Nfind("Some error!")
ELSE
	Okey({"The relation into the base",;
		2->(ALIAS())+" order " + 2->(OrdKey()),;
		"is established!", ;
		"First related recno() is "+NTRIM(2->(recNo())) })
ENDIF

CLEAR RELATION

//Now, another way
SELECT 2

SET TAG TO char
Nfind(OrdKey())

SELECT 1

RelationKey:="char"

SET RELATION INTO child
GO TOP
IF EMPTY(DBRelation(1))
	Nfind("Some error!")
ELSE
	Alert({"The relation into the base",;
		2->(ALIAS())+" order " + 2->(OrdKey()),;
		"is established!", ;
		"First related recno() is "+NTRIM(2->(recNo())) })
ENDIF

lNoReOpen:=.T.		//Disable main file Re-Open
