Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Free tables data path
Message
From
10/12/2004 15:22:58
 
 
To
10/12/2004 14:28:25
General information
Forum:
Visual FoxPro
Category:
The Mere Mortals Framework
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows 2000 SP4
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00968376
Message ID:
00968394
Views:
10
>Hi all,
> I have several objects that use free tables as their cursorsource using cFreeTableCursors. I need to instantiate the objects and then set the cursorsource to a path read from another table. I have set AutoOpenTables to .F.. Where and how is the best place to set the ccursorsource to the free table and then OpenTables()?
>
Hi Randy

For all of my applications I do have an object (custom) named mytables.. Any new form that I create it is based in a object form named mybasicform.. This one it is already seted opentables/closetables to .f... In the init method it calls
=thisform.mytables.opening()
that cross for all tables declared on dataenvironment..
procedure thisform.mytables.opening
lcpath_of_mytables                = ".."
oform                             = iif(type("thisformset.DataEnvironment")<>"U", thisformset, thisform)
lnind1                            = 1
Do WHILE lnKeepsearch
   lsind                          = ALLTRIM(STR(lnind1,3,0))
   If  type("oform.DataEnvironment.Cursor&lsind")="U"
       lnKeepsearch               = .f.
       Loop
   Endif
   O                              = oform.DataEnvironment.Cursor&ind2
   If   TYPE("O")<>"U"
	lcFILE                    = allt(O.cursorsource)
	lcFILE                    = FORCEPATH(justfname(lcFILE), lcpath_of_mytables)
	lcalias                   = allt(O.alias)
	If  type("lcalias")="C"
	    If  empty(lcalias)
		lcalias            = juststem(lcFILE)
            Endif
	Endif
	If  USED(lcalias)
	Else
            sele 0
            If  O.exclusive
		Sele 0
		Use (WFILE) alias (walias) exclusive
	    Else
		Sele 0
		Use (WFILE) again alias (walias) shared
	    Endif
        endif
   endif
   *
enddo
endproc
From this point you can create a INI file to set the desired places for your free tables on lcpath_of_mytables variable..

HTH

Claudio
"Now to him who is able to do immeasurably more than all we ask or imagine, according to his power that is at work within us, Ephesians 3:20
Previous
Reply
Map
View

Click here to load this message in the networking platform