ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / Errors / WLanguage errors
  • Reason
  • Tip
  • Example
  • Using a control and a local variable with the same name
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Information 302: Ambiguity between a variable and a control
Reason
The same name was given to a control and to a local variable. In the current code, this name will represent the variable.
Tip
To avoid any ambiguity, we recommend that you use different names for your controls, windows and variables.
Example

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 correction
The 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…
Comments
Click [Add] to post a comment

Last update: 05/26/2022

Send a report | Local help