Hi Im working with C++Builder6, Im learning Reports (TQuickRep).
I have an example but this is a bit confusing. Ive found this line in the Main form. I dont know what that line do, because the __property setting by a brackets {read = *TQuickRep, write = void SetReport(TQuickRep*) } ???
I think is like some pascal or delphi notation. If someone could explain that notation I'll be grateful.
1 2 3 4 5 6 7
// FORM .H (header)
private: // User declarations
TQuickRep * FReport;
void SetReport(TQuickRep *);
public: // User declarations
__fastcall TMainForm(TComponent* Owner);
__property TQuickRep * Report = {read = FReport, write = SetReport}; // what does this line do?
The problem is that you're trying to understand it from the point of view of C++. That line is not C++, it just looks superficially like it.
Broken down:
1 2 3 4 5 6 7 8 9 10 11 12
__property // "The following declaration in this class is a property." A
// property is a special way to access data in a class. See:
// https://en.wikipedia.org/wiki/Property_(programming)
TQuickRep * // The type of the property.
Report // The name of the property.
= { // "OK, now I'm going to define the property."
read = FReport, // "When the property is read, use the function 'FReport' of
// this class."
write = SetReport // "When the property is written, use the function 'SetReport'
// of this class.
} // "I'm done defining the property."
; // "I'm done with this declaration."
Saw c++builder bolrland6 works with delphi and pascal extensions.
but I think thanks @helios answer this topic clearly. Now is time to make some tests to see if this is true.
The only thing is that TQuickRep * FReport is not a method, is a pointer watch.
So everytime Report is accessed the compiler will read *FReport.
Edit*: I made some test that prove @helios was right. Again Thank you very much for your answer mr helios, I know you use to answer most question in this wonderful language. See you all.