Difference between revisions of "REMOVEPROPERTY()"
Yvonnemilne (Talk | contribs) |
Yvonnemilne (Talk | contribs) |
||
| (7 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
==Purpose== | ==Purpose== | ||
Function to remove a property from an existing object | Function to remove a property from an existing object | ||
| Line 15: | Line 8: | ||
==See Also== | ==See Also== | ||
| − | [[CLASS]], [[DEFINE CLASS]], [[METHOD]], [[ | + | [[ACLASS()]], [[ADDPROPERTY()]], [[AMEMBERS()]], [[CLASS]], [[CLASS - Methods]], [[CLASS - Parameters]], [[CLASS - Properties]], [[CLASS - Scoping]], [[COMPOBJ()]], [[CREATEOBJECT()]], [[DEFINE CLASS]], [[DISPLAY CLASSES]], [[DODEFAULT()]], [[FOREACH]], [[LIST CLASSES]], [[LOADOBJECT()]], [[METHOD]], [[NEWOBJECT()]], [[OBJECT()]], [[PRINT_HTML()]], [[PRINT_JSON()]], [[PRINT_R()]], [[PRINT_XML()]], [[REQUIRE_ONCE()]], [[SAVEOBJECT()]], [[SQL SELECT]], [[WITH]] |
==Description== | ==Description== | ||
| − | The | + | 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. |
| Line 32: | Line 25: | ||
| − | + | All classes also have an inbuilt ''removeproperty'' [[CLASS - Methods|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'' [[CLASS - Methods|method]]. | ||
| Line 38: | Line 36: | ||
<code lang="recital"> | <code lang="recital"> | ||
define class myclass as custom | define class myclass as custom | ||
| − | myprop = "Hello World" | + | myprop = "Hello World" |
enddefine | enddefine | ||
| Line 47: | Line 45: | ||
Messagebox(myobject.myprop2) | Messagebox(myobject.myprop2) | ||
removeproperty(myobject, "myprop2") | removeproperty(myobject, "myprop2") | ||
| + | // Or: myobject.removeproperty("myprop2") | ||
</code> | </code> | ||
==Products== | ==Products== | ||
| − | Recital | + | Recital, Recital Server |
[[Category:Documentation]] | [[Category:Documentation]] | ||
[[Category:Functions]] | [[Category:Functions]] | ||
| + | [[Category:Objects]] | ||
| + | [[Category:Objects Functions]] | ||
Latest revision as of 15:12, 14 December 2009
Purpose
Function to remove a property from an existing object
Syntax
REMOVEPROPERTY(<object-name> ,<expC>)
See Also
ACLASS(), ADDPROPERTY(), AMEMBERS(), CLASS, CLASS - Methods, CLASS - Parameters, CLASS - Properties, CLASS - Scoping, COMPOBJ(), CREATEOBJECT(), DEFINE CLASS, DISPLAY CLASSES, DODEFAULT(), FOREACH, LIST CLASSES, LOADOBJECT(), METHOD, 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")
Products
Recital, Recital Server