Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Searching through all application directory...
Message
 
 
To
19/10/2000 11:19:30
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00430305
Message ID:
00431581
Views:
23
>>How can you close this form after this line? Otherwise too much files open...
>
>You can do an ACTIVATE WINDOW Form (or somtehing similar) to make sure the form designer has focus, then put a KEYBOARD '{Ctrl+W}'. If it doesn't work, searc for it to get the exact syntax, I know I've psoted this before.

Mike,

This is the version based on your idea. Unfortunately, I can not get the result here, because too many forms have some problems (data files could not be found or old class libraries are used).
********************************************************************
*  Description.......: SearchScxM - searches all SCX files for SearchString in MethodToSearch
*  Calling Samples...:
*  Parameter List....: pcSearchString, pcMethodToSearch
*  Created by........: Mike Helland
*  Modified by.......: Nadya Nosonovsky 10/18/2000 03:01:23 PM
********************************************************************
lparameters pcSearchString, pcMethodToSearch
if vartype(pcSearchString)<>'C'
     pcSearchString=upper("SetFocus")
else
     pcSearchString=upper(pcSearchString)
endif
if vartype(pcMethodToSearch)<>'C'
     pcMethodToSearch=upper("Init")
else
     pcMethodToSearch=upper(pcMethodToSearch)
endif
=GetAllFiles1('\redp\appl','scx') && Creates cursor filesADIR of all scx files
local lcTextString
#define CRLF chr(13)+chr(10)
lcTextString = ''
select FilesAdir && cursor with all scx files
on error suspend
scan
    if not file(forceext(cFileName,'sct')) or 'backup'$lower(cFileName) or 'old'$lower(cFileName) && Memo file is not there or backup form
        && Skip this form
    else 
          modify form (alltrim(cfilename)) nowait
           =aSelObj(aA, 1)
           llFlag=.f. 
           llFlag=(atc(pcSearchString, aA[1].ReadMethod(pcMethodToSearch))>0)     
           ? llFlag
           if llFlag && Found
               lcTextString = lcTextString  + FilesAdir.cFileName+ ': ' +pcSearchString + CRLF + ;
                         ' found in '+pcMethodToSearch + CRLF + CRLF
           endif               
*!*                 activate window 'form' && Make this window active
*!*              keyboard '{ctrl+w}' && Close it
          release window 'form'
*         messagebox( cfilename )
         replace flag with llFlag
     endif
*     select FilesAdir && safety meassure
endscan && each app dir
if len(lcTextString) > 0
     =strtofile(lcTextString,'Result.TXT')
     modi file 'Result.TXT'
endif
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform