|
|
|
|
- Reason
- Correction
- Example
- Using a constant member in the click code of a button
Error 1010: The member of the class is constant
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.
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.
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…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|