Say that the gadget GREP
?
I don't know which day, I can't remember, GREP met me, not saying that I found it, it is a C Builder comes with command line gadgets, this seems to be a small program However, it may be a key to bring you great convenience, I have had such an experience, this is the case, I am doing a program about the desktop theme, I use the Ocr_NORMAL this mouse parameter, I originally I want to change my style to show my style of this program. How can I know that Tiangong doesn't make a beautiful compilation? "Undefined Symbol 'Ocr_NORMAL' symbol is not error, this error itself is very simple, just find the header file that defines its header file over Over However, how can we find its definition in the VCL in the statement of the header file! This may be a big engineering, but the performance of GREP has changed greatly, with the help of GREP So fasting this problem quickly.
?
The compilation error is as follows:
[C Error] Unit1.h (47): E2451 undefined symbol 'ocr_normal'
??? Solution:
D: / program files / borland / cbuilder6 / include> grep ocr_normal * .h
?
File Winuser.h:
#define ocr_normal ?????????? 32512
#DEFINE OCR_ICON ???????????? 32641 ?? / * Obsolete: Use Ocr_NORMAL * /
?
Oh, "Ocr_NORMAL" is a macro definition in the Winuser.h header file, next, I think you know how to solve it! In fact, when [C Error] Unit1.h (47): E2451 undefined Symbol 'Ocr_NORMAL' Similar to the error, as long as "F1" will appear GREP's figure, just don't pay attention to it, the following is me The result of (Press F1):
Possible Causes
Actual Declaration of Identifier Has Been Comment Out.
Misspelling, Either at this point or at the decaration.
An Error In The Declaration of the Identifier.
The Header File in Which The Identifier Is Declared Was Not Included Using #Include
?
Tools to Help TRACK DOWN TRAE PROBLEM:
GREP
?
Ok, let's talk about it, let's go back to the topic of Grep, I plan to introduce Grep from the following four aspects:
?
1: Graphic structure of GREP
2: Common Command-Line Options
3: Character or string pattern match
4: Analysis of EXAMPLE
?
?
GREP grammar:
Grep [-Options] searchString [file (s) ...]
?
Tip: If the result of GREP is very long, you can use the | More to make a split display, or you can redirect it to the file.
Split screen display: GREP "CIN" * .h | More
Redirection to file: grep "cin" * .h> readme.txt?
Common COMMAND-LINE OPTIONS:
?
-c? Only the number of rows where the file where the search string is displayed, of course, it must list the file name of the file where the search string is located.
-d ???? It decides whether to search the subdirectory, this property will not be set by default.
-I? Ignore characters case, such as "Sub" and "SUB" equivalent
-l? Only the file name of the file where the search string is located
Other properties such as: -u, -v, -z, etc. You can refer to online help.
Character or string pattern match
?
Character or string pattern matching is simple to set up a matching method of character or string so that you can get results as soon as possible. In fact, it mainly involves processing of some special characters. For example: spaces and tabs are generally separated by the command parameters, but sometimes the string to match itself, which is included in the space or tab, how do you handle, a wise practice is to match the characters to match, this It is a matching method of characters or strings. Those special symbols are mainly included in the table below:
? * ???? Match any character or string, can be empty
? ??? Almost the *, but not empty, such as: Hell does not match the Hell, Hell * is matched with Hell
???? [] ??? Match any one of [], such as HE [MPL] matches HEM, Hep, Hel matches, does not match Hello
???? [^] ??? and [] just in contrast, it matches other characters in [], HE [MPL] with HEM, HEP, HEL does not match, match HEX matches
???? [-] ??? used to represent a collection, such as any match in [0-9]
????? /? ?? Make the / it's a character escape, such as: * Originally indicating wildcard, but only means a normal "*" character after it
?
EXAMPLE analysis:
?
GREP -I [A-C]: //data/.fil * .c * .inc
??? Parameter-I will ignore the case, [AC] indicates any one of characters a to c, which can match it, // The result of // The result is "/" so the following is [AC]: // Data / .fi can match strings:
A: /DADA.FIL
C: /DATA.FIL
?
?