Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Not possible to scan dataenvironment objects!?
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00231556
Message ID:
00231580
Views:
17
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
Previous
Reply
Map
View

Click here to load this message in the networking platform