Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Not possible to scan dataenvironment objects!?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00231556
Message ID:
00231580
Vues:
19
Hi Andrus,

>
>I need to change CursorSource property because at run-time, files are at different locations.
>The only reasonable place to do it seems to be BeforeOpentables event.
>However, it is not possible to loop through cursors: dataenvironment does not have objects collection and cursor object names are changed.
>

To "scan" the DE Objects use the aMembers function. Try something like this:
** Set Database reference to current DBC
lcDbc = fullpath(dbc())
lnMembers = aMembers(laMembers, This.DataEnvironment, 2)
for x = 1 to lnMembers
	with eval("This.DataEnvironment." + laMembers[x])
		if .BaseClass = "Cursor" ;
		and !empty(.DataBase)
			.DataBase = lcDbc
		endif
	endwith
endfor
HTH,
Bill Armbrecht
Bill Armbrecht
VFP MCP
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform