PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US

  • 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/iPadApple WatchUniversal Windows 10 AppWindows Mobile
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 code line can be kept as is or, if Edit1 corresponds to 2 different elements, the Edit1 variable can be renamed. This rename operation avoids confusion.
Minimum required version
  • Version 0
This page is also available for…
Comments
Click [Add] to post a comment