|
|
|
|
- Reason
- Tip
- Example
- Using a control and a local variable with the same name
Information 302: Ambiguity between a variable and a control
The same name was given to a control and to a local variable. In the current code, this name will represent the variable. To avoid any ambiguity, we recommend that you use different names for your controls, windows and variables. Using a control and a local variable with the same name Code triggering the message
The window contains an Edit1 control and a Button1 button. In the click code of the button, Edit1 is redefined and it corresponds to a Boolean variable.
// -- Click on button1 Edit1 is boolean = True
Possible correctionThe line of code can be kept as is or, if Edit1 corresponds to 2 different elements, the Edit1 variable can be renamed. This rename operation avoids confusion.
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|