Search difficulties

triplemaya

Member
Joined
Aug 27, 2006
Messages
15
Programming Experience
Beginner
Hi. I am trying to solve a problem in some code I have inherited, but when I search for a string in VS 2005 express, I cannot find it. I presume that the string is in the project somewhere, because it is displayed in an error message. The string is "Error on load file". I am pretty sure this is not a standard VB error dialog, so it must be part of my app. The search facility in VS can't find it. I have had this problem before, I find it severely difficult in trying to program in this environment with someone else's code when I can't search for a string I am looking for.

There are a lot of files in this project, and reading them all for a single string is going to take a lot of time. And I might miss it with fatigue! There must be a way to solve this problem, would someone please tell me how to proceed with this. I have never worked with a system of this nature before, all my programming was done in C/UNIX, so I am used to being able to search files with an ordinary search facility, using operating system tools if necessary, but the vb files aren't readable. Not by microsoft os anyway.
 
Who knows where the line could come from. You can check to see if
its found in any files associated with the directory where your project
is stored.

Run your dos shell, change directory to where you project is stored,

and for each directory there, issue the following dos shell command:

Dir /N "Error on load file" *.*

The file name and line that the string was found in will be printed.
 
Thanks, but it doesn't work!

Thank you very much for your reply, but when I try it it reports finding the string in about twenty files, and in large nubmers! And that whole string is not present in the files I chekced. I looked all through! I think it must be searching for any of those words.
 
DIR command doesn't search inside files, only lists the expressed files. FIND command would, but you might as well use Explorer search. Also VS got lots of options to search different files in project, but it is not certain either will return the string, it could be a compiled resource. Anyway, I'd use the VS search first specifying to include whole project in search and case-insensitive etc, second try'd be Explorer search. What do you mean files aren't readable? The .vb files are plain text. If you mean compiled libraries you're right, but there is no way to read or modify them anyway.
 
missed strings in explorer

Many thanks for that John. My whole problem is that explorer doesn't search the files, and I can't understand why. In one of the files there is a line
MsgBox("Error on Loading File")

but when I search for the string
Error on Loading

in that directory it is not found in any file.

That's m' problem!

Come to that, it doesn't find MsgBox either, and there are a great many instances of that in those files!

I am totally perplexed why this should be so, since I'm using a case insensitive search, and .vb files appear to be ordinary text files - I can open them with notepad. But fido just doesn't find the strings.

( Don't know why I thought the files aren't readable, probably because explorer find didn't report any of the strings I knew were in there )

In VS I'm using whole project case insensitive search, so I suppose that is the best I'm going to get.
 
Strangeness, I'm sure I used Explorer Search for this before but it only search .txt files now even if I specify *.vb or *.*. Until someone finds the solution you can explore the commandline utility FINDSTR, it is a very powerful search that also can recurse all subfolders. Use the /? switch to get help on this command after you entered Cmd.exe shell.
 
why don't you just debug the app and trace the events leading up to the msgbox. Also Are you certain that you checked "Search Entire Project" under the find option in vs.net? This will check all associated files in the project. Unless the developer stuck the error messages in a seperate file (Which would make no sense), or has the error messages coming from the db, then you should be able to find it. If it's not found that way, the trace would definantly be the way I would go. I also wouldn't eliminate the error coming from vb.
 
Back
Top