Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What is the best way to do a search ?
Message
From
19/08/1999 11:13:11
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
19/08/1999 10:43:42
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00255279
Message ID:
00255308
Views:
12
>I am using VFP 3.0
>
>I want to change the location of a listbox. It will be in a page contained in a pageframe.
>
>What would be the best way to search for all occurences of that listbox reference in the code used throughout that form so that I could be able to change the path to that object?
Denis,
I use this quick code for such stuff :
LPARAMETERS tcSearchString, tcExtension

lcDir = getdir("","Where are files are located?")
IF empty(lcDir)
	RETURN
ENDIF

CREATE cursor flist (scxname c(30), fieldname c(20), recnumber i)
SELECT 0
=adir(aFormfiles,lcDir+"*."+tcExtension)
FOR fcnt = 1 to alen(aFormfiles,1)
	USE (lcDir+aFormfiles[fcnt,1]) alias current
	SCAN
		FOR ix = 1 to fcount("current")
			IF type(field(ix,"current"))$"CM" ;
					and atc(tcSearchString, eval(field(ix,"current")))>0
				INSERT into flist values ;
					(aFormfiles[fcnt,1], field(ix, "current"), recno("Current"))
			ENDIF
		ENDFOR
	ENDSCAN
	USE
ENDFOR
SELECT flist
on key label "F2" do EditTarget
go top
BROW
on key label "F2"

Function EditTarget
use (lcDir+trim(flist.scxname)) in 0 alias EdtSCX
go flist.recnumber in "EdtSCX"
select EdtSCX
wait window nowait "Field name is : "+(trim(flist.fieldname))
browse
use
select flist
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform