Difference between revisions of "REMOVEPROPERTY()"
Yvonne.milne (Talk | contribs) |
Helen.george (Talk | contribs) |
||
(4 intermediate revisions by 2 users not shown) | |||
Line 11: | Line 11: | ||
The REMOVEPROPERTY() function is used to remove a property from an existing object. It returns .T. (True) if the property was successfully removed and .F. (False) otherwise. | The REMOVEPROPERTY() function is used to remove a property from an existing object. It returns .T. (True) if the property was successfully removed and .F. (False) otherwise. | ||
− | {| class="wikitable" | + | {| class="wikitable" width="100%" |
− | !Parameter||Description | + | !width="30%"|Parameter||Description |
|- | |- | ||
|<object-name>||The name of the object. | |<object-name>||The name of the object. | ||
Line 20: | Line 20: | ||
|} | |} | ||
− | All classes also have an inbuilt | + | All classes also have an inbuilt removeproperty method. This can be used as an alternative to the REMOVEPROPERTY() function to remove properties from an object at runtime. |
<object-name>.removeproperty(<expC>) | <object-name>.removeproperty(<expC>) | ||
− | Properties can be added using the ADDPROPERTY() function or inbuilt | + | Properties can be added using the ADDPROPERTY() function or inbuilt addproperty method. |
==Example== | ==Example== | ||
Line 44: | Line 44: | ||
[[Category:Functions]] | [[Category:Functions]] | ||
[[Category:Objects]] | [[Category:Objects]] | ||
− |
Latest revision as of 07:15, 4 February 2013
Contents
Purpose
Function to remove a property from an existing object
Syntax
REMOVEPROPERTY(<object-name> ,<expC>)
See Also
ACLASS(), ADDPROPERTY(), AMEMBERS(), COMPOBJ(), CREATEOBJECT(), DEFINE CLASS, DISPLAY CLASSES, DODEFAULT(), FOREACH, LIST CLASSES, LOADOBJECT(), NEWOBJECT(), OBJECT(), PRINT_HTML(), PRINT_JSON(), PRINT_R(), PRINT_XML(), REQUIRE_ONCE(), SAVEOBJECT(), SQL SELECT, WITH
Description
The REMOVEPROPERTY() function is used to remove a property from an existing object. It returns .T. (True) if the property was successfully removed and .F. (False) otherwise.
Parameter | Description |
---|---|
<object-name> | The name of the object. |
<expC> | The name of the property to be removed. |
All classes also have an inbuilt removeproperty method. This can be used as an alternative to the REMOVEPROPERTY() function to remove properties from an object at runtime.
<object-name>.removeproperty(<expC>)
Properties can be added using the ADDPROPERTY() function or inbuilt addproperty method.
Example
define class myclass as custom myprop = "Hello World" enddefine myobject = createobject("myclass") Messagebox(myobject.myprop) addproperty(myobject, "myprop2", "goodbye") // Or: myobject.addproperty("myprop2", "goodbye") Messagebox(myobject.myprop2) removeproperty(myobject, "myprop2") // Or: myobject.removeproperty("myprop2")