Log On
Embarcadero Home
Watch, Follow, &
Connect with Us
Share This
QualityCentral
Communities
Articles
Blogs
Resources
Downloads
Help
QualityCentral
Delphi-BCB
IDE
Add Component Template
Background compile
Batch file target
Block Completion
Build Tools
Caliber
Class Completion
Class Explorer
Code Browsing
Code Completion
Code Editor
Code Explorer
Code Parameters
Code Templates
Compiler Message Window
Deployment Manager
Dialogs
Direct
Docking
File Browser
File Handling
Form Designer
Help
History View
IDE Insight
Memory Issues
Menu Designer
Menus
Module Manager
Multi-Monitor Support
Object Inspector
Object TreeView
Open Tools API
Packages
Performance
Printing
Project Explorer(old Object Browser)
Project Management
Refactoring
Repository
Save Desktop
Search
Start Page
Starteam
Startup/Shutdown
Structure Pane
System Resources
ToDoList
Tool Palette
Toolbars/Status Line
Translation Tools
Unit Testing
Version Control
VersionInfo
Views
Visual Form Inheritance
Workgroup(PVCS)
You are not logged in.
Help
Print
Public Report
Report From:
Delphi-BCB/IDE/Class Explorer
[ Add a report in this area ]
Report #:
81729
Status:
Closed
Error in Class Explorer when using existing methods to implement a property
Project:
C++Builder
Build #:
14.0.3593.25826
Version:
14.0
Submitted By:
Peter Hull
Report Type:
Basic functionality failure
Date Reported:
2/2/2010 4:37:50 AM
Severity:
Serious / Highly visible problem
Last Updated:
3/20/2012 2:24:39 AM
Platform:
All versions
Internal Tracking #:
274798
Resolution:
Fixed
(Resolution Comments)
Resolved in Build:
:
Duplicate of:
None
Voting and Rating
Overall Rating:
No Ratings Yet
0.00 out of 5
Total Votes:
None
Description
When adding a property there is an option to use existing methods for its implementation. This option gives a confusing/irrelevant error message and generates code that won't compile.
Steps to Reproduce:
1. Start with a class defined like this
class TTester {
private:
void SetValue(int);
int GetValue();
};
2. Use Class Explorer to add a property, Name= Value, Type= int, Visibility= public, and select Existing Field/Method = GetValue() for Read and Existing Field/Method= SetValue(int) for Write
3. Press Add
4. See error message 'GetValue() is not a valid identifier. Root filenames of IDE-managed units must be valid identifiers.'
Generated code is wrong and won't compile:
class TTester {
private:
void SetValue(int);
int GetValue();
public:
__property int Value = {read=GetValue(), write=SetValue(int)};
};
Should be
class TTester {
private:
void SetValue(int);
int GetValue();
public:
__property int Value = {read=GetValue, write=SetValue};
};
Workarounds
None
Attachment
None
Comments
Peter Hull at 2/3/2010 2:30:54 AM
-
This also doesn't work if a property is based on an existing field, for example, basing a property 'Value' on field 'FValue' in this class:
class TTester
{
private:
int FValue;
};
becomes
class TTester
{
private:
void __fastcall FValue(int val);
int __fastcall FValue();
int FValue;
public:
__property int Value = {read=FValue, write=FValue};
};
i.e. it erroneously adds in method signatures for 'FValue'
Tomohiro Takahashi at 2/3/2010 6:32:15 PM
-
Thanks for the update.
Could you please put new report about the issue in QC? I will open it.
Peter Hull at 2/4/2010 3:14:12 AM
-
Done, see report number 81795.
View Your Reports
Search
Server Response from: ETNACODE01
Developer Tools
Blackfish SQL
C++Builder
Delphi
FireMonkey
Prism
InterBase
JBuilder
J Optimizer
HTML5 Builder
3rdRail & TurboRuby
Database Tools
Change Manager
DBArtisan
DB Optimizer
ER/Studio
Performance Center
Rapid SQL
Technical Articles
Tutorials
White Papers
Press Releases
Newsletters
Add Content (GetPublished)
Audio
Audio & Video
Video
Bugs & Suggestions (QualityCentral)
Discussion Forums
Examples (CodeCentral)
Tags
Technology Partners
Downloads
Free Trials
Registered User Downloads
Beta Programs
Add Content (GetPublished)
Articles
Blogs
Bugs & Suggestions (QualityCentral)
Discussion Forums
Examples (CodeCentral)
Member Services
About
Connect with Us