Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Searching through all application directory...
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00430305
Message ID:
00430694
Views:
30
That's neat as well Ed.

>>Cool!
>>
>>>>I'd like to search through all applications (which are located under APPL directory in its own directories with subdirectories) and search for SetFocus() in Form's.Init.
>>>
>>>Use Adir to get every SCX file, do a MODI FILE NOWAIT on all files found, then do an aSelObj(aA, 1) and this will tell youf is SetFOcus() is in the Init method:
>>>
>>>?'SetFocus()' $ aA[1].ReadMethod('init')
>
>Another approach, similar but manipulating this a bit differently, uses this logic. I've denoted sections of pseudocode in red to let you know where you've gotta come up with your own code:
>
>
oReg = CREATEOBJ('VBScript.RegExp')
>oReg.Global = .t.
>oReg.IgnoreCase = .t.
>oReg.Pattern = 'PROCEDURE INIT([^\0]*)ENDPROC'
>#DEFINE CRLF CHR(13)+CHR(10)
>cInitsWithSetFocus = ''
>FOR Each cFormSubDirPath IN all app's directory tree
>   cStartDir = FULLPATH(CURDIR())
>   CD (cFormSubDirPath)
>   DIMENSION aSCXFiles[1,5]
>   nForms = ADIR(aSCXFiles,'*.SCX')
>   FOR i = 1 TO nForms
>      USE (aSCXFiles[i,1]) AS ThisSCX
>      SCAN FOR 'form' $ lower(BaseClass) AND ! EMPTY(Methods)
>         oReg.Execute(ThisSCX.Methods)
>         FOR EACH oMatch IN oReg.Matches
>            IF 'SETFOCUS' $ UPPER(oMatch.Value)
>               cInitsWithSetFocus = cInitsWithSetFocus + cFormSubDirPath + ' ' + ;
>                                    aSCXFiles[i,1] + ': ' +ThisSCX.ObjName + CRLF + ;
>                                    oMatch.Value + CRLF + CRLF
>            ENDIF
>         ENDFOR && each match
>      ENDSCAN  && each form rec in SCX
>   ENDFOR && each SCX
>   USE IN ThisSCX
>ENDFOR && each app dir
>   CD (cStartDir)
>IF LEN(cInitsWithSetFocus) > 0
>   =STRTOFILE(cInitsWithSetFocus,'InitsWithSetFocus.TXT')
>ENDIF


If we were to introduce Visual FoxBase+, would we be able to work from the dotNet Prompt?


From Top 22 Developer Responses to defects in Software
2. "It’s not a bug, it’s a feature."
1. "I thought I fixed that."


All my FoxTalk and other articles are available on my web site.


Unless specifically identified otherwise, anthing posted here is purely my opinion and may or may not reflect the policies or practices of Microsoft.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform