Because C Builder is a compilation language, not the interpreted language, so it doesn't have Visual FoxPro that macro change. In fact, this problem has appeared last summer, I was the most stupid method to use the enumeration method one by one, I saw STL, I saw the STL, I feel that I can solve the problem with the MAP container, and give a simple The example is this problem. For example, in TForm1 we have 20 Edit, we assume that their names are edit1 to edit20 (of course, they can also name their more meaningful names), and now require these EDIT controls Name to access them. Solution: If we store the names of these EDIT controls and points to these controls, we will find it through their name, then the problem is easy to solve, if you have seen STL, you will naturally think of it. The MAP container in the STL is relatively convenient. The following is given:
.h file # include
// first of all, storing all edit's pointer and name for (int i = 0; i
} Else {// Todo: add your code here ..... Return null;}} // Declaration is just the rough framework of my program, fully expressing my idea, if you want to join your program needs to make Adjustment.