Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Data Environment
Message
From
25/09/2004 00:19:10
 
 
To
24/09/2004 20:36:54
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00945941
Message ID:
00945956
Views:
22
>I have a couple hundred view based SCX/SCT files. I need to write a program to extract the table and views used in all these forms. Would appreciate if you could advise an easy way to get this info from the SCX/SCT files.
>
Hi Tek,

The code below shows a way (with tables).. For views (I'm not sure) it's necessary some modifications:
ind1                              = 1
cwpath1                           = "c:\myfolderlocation"
cwpath2                           = "c:\someotherfolder"
oform                             = iif(type("thisformset.DataEnvironment")<>"U", thisformset, thisform)
llError                           = .F.
lwkeep_search                     = .t.
*
Do WHILE lwkeep_search
   ind2                           = ALLTRIM(STR(ind1,3,0))
   If  type("oform.DataEnvironment.Cursor&ind2")="U"
       lwkeep_search              = .f.
       Loop
       * exit
   Endif
   O                              = oform.DataEnvironment.Cursor&ind2
   If  TYPE("O")<>"U"
       cWFILE                     = allt(O.cursorsource)
       cWFILE                     = FORCEPATH(justfname(cWFILE), cwpath1)
       cwalias                    = allt(O.alias)
       If  type("cwalias")="C"
	   If  empty(cwalias)
	       cwalias            = juststem(cWFILE)
           Endif
       Endif
       If  USED(cwalias)
       Else
            If  FILE(FORCEPATH(justfname(cWFILE), cwpath1))
		cWFILE            = FORCEPATH(justfname(cWFILE), cwpath1)
            Else
                cWFILE            = FORCEPATH(justfname(cWFILE), cwpath2)
            endif
            If  file(cWFILE)
        	Sele 0
		If  O.exclusive
                    Use (cWFILE) alias (cwalias) exclusive
                else
                    Use (cWFILE) again alias (cwalias) shared
                endif
		If  llError
		    * error on open table or view
		Endif
     	    Else
		* not found
            Endif
       	    * setting order
            If  used(walias)
		si                         = ALLTRIM(STR(ind1,3,0))
		If  type("oform.DataEnvironment.Cursor&si") <> "U"
		    OORDER                 = oform.DataEnvironment.Cursor&si
		    Sele (cwalias)
		    If  empty(OORDER.order)
		    Else
			Set ORDER TO (OORDER.order)
	            Endif
		Endif
            Endif
       Endif
       ind1                           = ind1 + 1
       WPROCURA                       = ind1 < 99
Enddo
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