Searching through VB Source
Windows has a lovely feature "Search" which allows you to find a file containing some string value.
When you run this on VB Source it never finds anything inside the source as it is recorded in some form other than straight ASCII characters
Looking at the source in Hex mode reveals a word Form1 recorded as F.o.r.m.1. and so on (the . is not a full stop)
Currently I am hunting through hundreds of programs looking for a particular piece of code - but cannot get help from a search tool
Has anyone ever come across a tool which will allow you to search source code recorded VB format ?
[623 byte] By [
George1111] at [2007-11-19 7:25:53]

# 1 Re: Searching through VB Source
this is simply a different style of encoding text (i.e. its not ASCII). It is called UNICODE.
In UNICODE each character is represented by 2 bytes. The "full-stops" that you are noticing is the other byte of the character. To make UNICODE sort of compatible with ASCII the first "set" in UNICODE (i.e. when the other byte is 0) are the standard ASCII characters.
So, whatever function you are using needs to be unicode compatible (also called "Wide Character" compatible). Usually string functions in win API have two versions one is an ASCII version the other is a UNICODE version. The ASCII version is denoted by an "A" at the end of the function name and UNICODE (Wide character) version by a "W".
Hope this helps you to understand what is going on.
But, I must point out that I have always found my VB source to be stored in a standard (ASCII) text file.
# 2 Re: Searching through VB Source
That was the term - UNICODE - thanks
If you open any VB Source object (.bas, .vbp,.frm) with noteapd, you can see the code and it all reads just like ASCII
So why can't the windows Search Function read it ???
Ie, Search for any file which contains a string "whateverstringyouwanttofind"
It does not work - I wonder why ?
# 3 Re: Searching through VB Source
well, like I said VB code is not stored in UNICODE, it is a flat ASCII file. The reason that the search function doesn't find it I would guess is because the search utility probably has a setting which excludes it from searching .frm, .mod etc files. (Well more specifically it tells it to only look in .txt, .doc etc files).
but that is a guess.
# 4 Re: Searching through VB Source
If your system is fully Unicode enabled, then notepad will show you the text correctly, as if the extra characters aren't there. Try opening the file in the DOS file editer. My guess is that you will see the extra characters as spaces.
A Hex editor utility should be capable of searching through the file, but if you are looking to check a lot of files, that's not such a good option. You might just be better off writting a small program to recurse through all files in a folder, load any .frm, .cls, or .bas files into a string one at a time, and use Replace$() to remove all Chr$(0)'s. Then use InStr() to find the text you want.
# 5 Re: Searching through VB Source
Google Desktop Search (Freeware) will find these on my machine, as will Windows Grep (Shareware).
http://desktop.google.com/
http://www.wingrep.com/