>Hi,
> I am using VFP 5.x and wondering whether there is anyway of searching for a pattern in the source code of forms from the VFP IDE. Suppose I want to search for a string "SaveChanges()" in all the event handlers in all the forms etc. Is there any command in VFP to do that?
>
>Suppose I want to print the all event handler code, Is there any way of doing that?
>
>I appreciate ur help.
>
>Thanks
>Puri Malluru
Yes there is. Look at the code below (just pasted from a util-program from my current project, used to find references of any kind in all methods)
I assume you can use this to rewrite it so it prints your events.
set talk off
close all
clear all
release all
set deleted on
set safety off
set memowidth to 200
if .t.
use libs\aapp.vcx
do lijst
use libs\abizness.vcx
do lijst
use libs\acstctrl.vcx
do lijst
use libs\aforms.vcx
do lijst
endif
if .t.
use data\cdbk30.dbc
do lijst2
endif
close all
return
procedure lijst
set print on
index on objname+"M" to d:\temp
lcwissel = "XXX"
scan for !empty(methods)
* ? objname+":"
for lnTeller=1 TO MEMLINES(methods)
IF LEFT(MLINE(methods, lnTeller), 9)="PROCEDURE"
lcProc = SUBSTR(MLINE(methods, lnTeller), 10)
lnLine = 0
* ? " "+lcProc
ENDIF
lcText=UPPER(MLINE(methods, lnTeller))
IF LEFT(lcText,1)<>"*" .AND. ;
("DATVRS"$lcText .OR. ;
"DATAFD"$lcText .OR. ;
"DATAANM"$lcText .OR. ;
"DATAFR"$lcText .OR. ;
"INTDAT"$lcText)
if !lcWissel==lcProc
lcWissel=lcProc
? objname+"("+parent+")"+":"+lcProc
* ? " "+TRANSFORM(lnLine, "99999")+"="+lcText
ENDIF
ENDIF
lnLine=lnLine+1
next
endscan
set print off
return
procedure lijst2
set print on
SCAN FOR Objecttype="View"
IF "WARMTE"$UPPER(PROPERTY)
? rtrim(objectname)
ENDIF
ENDSCAN
set print off
RETURN
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only