Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How can I search string in all classes within my classli
Message
From
25/03/2000 15:26:00
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00350248
Message ID:
00350427
Views:
28
>Hi Cetin,
>
>>>I need to find 'thisform.lockscreen' in all my classes code. Is there an easy way to do it?
>>>
>>>Thanks in advance
>>
>>
Nadya,
>>This could also help :
>>
Lparameters tcSearchString, tcExtension
>>
>>lcDir = getdir("","Where 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
>
> Thanks a lot for this code, I'll see, if I can use it. Just one question: is it safe to edit directly scx file or vcx file? Especially vcx? For safety I would archive these classes before edit.
>
> BTW, I usually change scx file directly if I want to repoint one of form's object to another class...


Nadya,
It's safe as long as you know what you're changing (e.g.Methods, properties, classloc etc). Another simple way is to view class code in class browser and from info you got there go and edit relevant PEM.
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
Reply
Map
View

Click here to load this message in the networking platform