ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / Errors / WLanguage errors
  • Reason
  • Correction
  • Example
  • Using a constant member in the click code of a button
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
Error 1010: The member of the class is constant
Reason
You are trying to modify a constant member of the class.
Reminder: A constant member is accessible in read-only. A member can be:
  • Protected constant: The value of the member can be read and modified from inside the class and the value of the member can be read from a derived class. The access to the member will be forbidden from any other section of the code.
  • Public constant: The value of this member can be read and modified from inside the class or from a derived class. You will only be able to read the value of the member from any other section of the code.
Correction
Two possibilities:
  • Replace the constant member by a public member: the access to the member will not be restricted.
  • Do not handle the constant member in read/write mode.
Example

Using a constant member in the click code of a button

Code triggering the error
// -- Declare the class
Drawing is Class
PUBLIC CONSTANT
BaseColor is int  // Color
END
 
// -- Click code of a button
Drawing::BaseColor = LightRed
...
Possible correction
Use a public member.
// -- Declare the class
Drawing is Class
PUBLIC
BaseColor is int  // Color
END
 
// -- Click code of a button
Drawing::BaseColor = LightRed
...
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 05/26/2022

Send a report | Local help