Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Searching string in vbcode

Status
Not open for further replies.

Jacquesvdz

Programmer
Jul 2, 2003
9
ZA
Hi all.

Hope you can help me with this one.
I need to enter a string ex. PartyID in a textbox and then I have to select(browse) a url to .vbg project and it must search in all the code in the vbg. and so forth for the word "PartyID" and give me a total of words.

Any help will be Super

Thanx in advance.
Jacques

 
Since the .FRM (forms), .CLS (classes), .BAS(modules), .VBG (Group) and .VBP (Projects) are ascii based, you can first open the .vpg and from a while loop open the .vbp and from another while loop open all the .frm,.bas,.cls from the .vbp; for each .frm,.bas and .cls (another while) use the line input and the INSTR to search and use a count for each match...

Mal'chik [bigglasses]
 
VBG (VB Group), VBP (VB Project), FRM (VB Form) and BAS (VB code module) are all text files.

Open your VBG as a text file and look for each VBP file name. Open each VBP as a textfile and look for FRM and BAS files.
Search each BAS and FRM file for the required string, keeping running total.

As easy as that!


________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'People who live in windowed environments shouldn't cast pointers.'
 
Will it be something like this
This is a little bit advanced for me.
Can you maybe just help me with this loop
Like help me translate it into vb code if you guys don't mind



For each vbg file in listbox
Open vbg as textfile and get all vbp
For each vbp file in vbg
Open vbp as textfile and get all .frm
For each .frm in vbp
Open .frm as textFile
For each Stringwanted
intAmount = intAmount + 1
Do until Stringwanted is finished
Do until all form's are done

For each bas in vbp
Open bas as textfile
For each Stringwanted
intAmount = intAmount + 1
Do until Stringwanted is finished
Do untill all bas are done

For each .cls in vbp
Open cls as textfile
For each Stringwanted
intAmount = intAmount + 1
Do until Stringwanted is finished
Do untill all cls are done
Do until all vbp is done in vbg
Do until all vbg's is done in listbox
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top