Home > Back-end >  Delphi object attribute set of problems
Delphi object attribute set of problems

Time:11-17

Some problems encountered during learning, by looking up information or is not very full, I hope and can help solve, thank you!

(1) the property attribute set, they found an array type attribute is set to appear problem, also can't write, there are a lot of finding out information, unclear,
(2) the property attribute set, I found the record types of attributes, set the wirte also cannot modify the parameters, properties can only be read-only,
(3) attribute property Settings, find enum type attributes always complains,

Please recognize explain a little bit in the Delphi, objects, the properties of the interface, easily ignored what are the special points need to be aware of, because the research is not deep, ask for help

CodePudding user response:

You these three problems, only the second pretty special, record as attributes exist, not for record in a single numerical modification, need to get the first record the overall value of a copy of the copy, and then modify the copy, please write back the entire record: after
 
Var x: TR.
X:=ABC. Propertyx;
X.a:=XXX;
X.b:=XXX;
ABC. Propertyx:=x;


As for 1 and 3, I think you have a problem of usage, I suggest you post your code to look at problems

CodePudding user response:

Property shows that the look like ordinary variable assignment, but in essence, the value is through a function to the values, the assignment is through a procedure for the assignment

CodePudding user response:

Attributes cannot be directly read and write, to set the two methods, respectively, reading and writing the value of the attribute and reference of many examples, search on the net,
  • Related