Difference between revisions of "Addproperty Method"

From Lianjapedia
Jump to: navigation, search
(Created page with '{{Common Method}} Category:Methods Category:Common Methods')
 
Line 1: Line 1:
{{Common Method}}
+
__NOTOC__
 +
Adds a property to the object.
 +
 
 +
<pre>
 +
ob.addproperty(cProperty, Value)
 +
</pre>
 +
 
 +
==Arguments==
 +
 
 +
{|class="wikitable"
 +
!Argument||Type||Description
 +
|-
 +
|cProperty||C||Name of the new property
 +
|-
 +
|Value||Any||Value of the new property
 +
|-
 +
|}
 +
 
 +
 
 +
==Example==
 +
<code lang="recital">
 +
//
 +
// Lianja custom section for page "page1" section "section1"
 +
//
 +
namespace custom1
 +
public textbox1
 +
define class page1_section1 as section
 +
enddefine
 +
 +
define class info_button as CommandButton
 +
proc click
 +
Messagebox("Textbox created by " + textbox1.createdby + " at " + textbox1.created,0,"Info")
 +
endproc
 +
enddefine
 +
 +
proc page1_section1
 +
page1_section1 = createobject("page1_section1")
 +
 +
page1_section1.addobject("infobutton","info_button")
 +
infobutton.caption = "Information about Textbox 1"
 +
 +
page1_section1.addobject("textbox1", "Textbox")
 +
textbox1.text = "Textbox 1"
 +
textbox1.addproperty("createdby",user())
 +
textbox1.addproperty("created",time())
 +
return page1_section1
 +
</code>
  
 
[[Category:Methods]]
 
[[Category:Methods]]
 
[[Category:Common Methods]]
 
[[Category:Common Methods]]

Revision as of 09:59, 29 September 2011

Adds a property to the object.

ob.addproperty(cProperty, Value)

Arguments

Argument Type Description
cProperty C Name of the new property
Value Any Value of the new property


Example

//
// Lianja custom section for page "page1" section "section1"
//
namespace custom1
public textbox1
define class page1_section1 as section
enddefine
 
define class info_button as CommandButton
	proc click
		Messagebox("Textbox created by " + textbox1.createdby + " at " + textbox1.created,0,"Info")
	endproc
enddefine
 
proc page1_section1 
	page1_section1 = createobject("page1_section1")
 
	page1_section1.addobject("infobutton","info_button")
	infobutton.caption = "Information about Textbox 1"
 
	page1_section1.addobject("textbox1", "Textbox")
	textbox1.text = "Textbox 1"
	textbox1.addproperty("createdby",user())
	textbox1.addproperty("created",time())
return page1_section1