Page 1 of 1
Difference between XObjProperty() and .XProp()
Posted: Mon Aug 13, 2007 11:44 am
by ncrsn
X in subject is Set/Get/Erase.
Some time ago we found that custom properties can be accessed using mentioned object.XProp(CPROPNAME) method. Is there some difference between that and the good old XObjProperty(object, CPROPNAME) from UO module?
I'm asking because I haven't been able to spot one. Yet as far as I can tell this is not documented, so question is, should it be?
If so happens that both ways do the same, is there any reason to keep both or should one be removed from the future cores?
Posted: Mon Aug 13, 2007 5:35 pm
by mr bubbles
haha, i can imagine my script changes is getobjproperty is removed

I think it should be left as is, or get rid of the .xprop method. Who uses this anywhere apart from like data files (guilds/accs) anyway?
Posted: Mon Aug 13, 2007 10:11 pm
by Yukiko
I don't think you can use the function Get/Set/EraseObjProperty on accounts. As I recall you must use the methods. I could be wrong however. Lord knows I have been mistaken before.
As for removing anything I would rather nothing be removed but I'd vote for methods being removed before the UO.em functions being taken away.
Posted: Tue Oct 30, 2007 6:40 pm
by itec
mr bubbles wrote:Who uses this anywhere apart from like data files (guilds/accs) anyway?
Me for once, it's faster to write obj.GetProp("Prop"), then GetObjProperty(obj, "Prop"), and the method way feels more like the cprop is part of the object.
If I had to guess, I'd say it's another one of those forgotten features that never made in core-changes. And yeah, this should be added to pol docs under the UObject class. It's working fine and looks much better what the functions do. Just my opinion.
Posted: Sat Nov 03, 2007 8:57 pm
by CWO
I thought it was GetObjProperty that replaced UObject.GetProp....
Posted: Fri Nov 09, 2007 1:00 am
by Yukiko
I think you are right CWO. I assume that the methods were left in place for compatibility reasons. I have never tested GetObjProperty on accounts. I have never seen it used on account references even. Most always the method is used in those cases.