|
|
|
|
- Reason
- Correction
- Example
- Using a private member in the click code of a button
Error 1009: The member of the class is private
You are trying to access a private class member from a code other than a class code. Reminder: A private member can be handled from a code of the class only. Two possibilities: - Replace the private member by:
- A constant protected member: 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.
- A constant public member: 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.
- A public member: The access to the member will not be restricted.
- Do not handle this private member from one of the project codes.
Using a private member in the click code of a button Code triggering the error // -- Declare the class Drawing is Class  PRIVATE BaseColor is int  // Color END  // -- Click code of a button IF Drawing::BaseColor = LightRed THEN ...
Possible correction Use a constant public member. // -- Declare the class Drawing is Class PUBLIC CONSTANT BaseColor is int  // Color END  // -- Click code of a button IF Drawing::BaseColor = LightRed THEN ...
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|