PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US

  • Reason
  • Correction
  • Example
  • Using a private 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/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Error 1009: The member of the class is private
Reason
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.
Correction
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.
  • Don't handle this private member from one of the project codes.
Example

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
...
Minimum required version
  • Version 0
This page is also available for…
Comments
Click [Add] to post a comment