Page 1 of 1

Averiguar SetRelation

PostPosted: Thu Jun 14, 2007 7:41 am
by AngelSalom
Buenasss, ¿sabeis algun método para averiguar el DbSetRelation() existente en un alias? mi intención es guardar el relation existente, quitarlo hacer unos procesos y volver a restaurarlo.
Quiero incluirlo en una función que tengo que guarda el filtro, la posición y el índice de un alias para luego restaurarlos.

Gracias.

PostPosted: Thu Jun 14, 2007 8:35 am
by Antonio Linares
Angel,

Revisa el código de function\ErrSysW.prg

Es el error system de FWH y ahi se analizan lon índices, relaciones, etc. para mostrarlas en el error.log

PostPosted: Thu Jun 14, 2007 9:44 am
by Carlos Mora
Te sirve dBRelation()? del NG del Clipper:

Syntax

DBRELATION(<nRelation>) --> cLinkExp

Arguments

<nRelation> is the position of the desired relation in the list of
current work area relations. The relations are numbered according to
the order in which they were defined with SET RELATION.

Returns

DBRELATION() returns a character string containing the linking
expression of the relation specified by <nRelation>. If there is no
RELATION SET for <nRelation>, DBRELATION() returns a null string ("").


Obviamente si en la expresion hay referencias a variables locales, creo que se va a complicar un poco.
Lo ideal sería tener una funcion que retorne una referencia al codeblock que se especifica en el momento de hacer la set relation, no se si en Harbour existe.

Saludos.

PostPosted: Thu Jun 14, 2007 3:03 pm
by R.F.
Sacto !, dbrelation() es lo que necesitas