I have forms with tables in their Dataenvironment.
At form design time, VFP stores relative path of those cursors into cursor CursorSource. property
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.
Is there a way to do this?
Currently I use the followin code in BeforeOpenTables.
But cursor names are changed sometimes, so this will not work:
i = 1
do while type('this.Cursor'+ltri(str(m.i))+'.name' ) = 'C'
local lobj
lobj = eval( 'this.Cursor'+ltri(str(m.i)) )
if type( 'o.CursorSource')='C'
o.CursorSource = 'c:\mypath'
endif
i = i + 1
enddo
Andrus