Set: Difference between revisions

From NSB App Studio
Jump to navigation Jump to search
No edit summary
 
(5 intermediate revisions by 3 users not shown)
Line 1: Line 1:
Set ''objectvariable'' = {''objectexpression'' | NOTHING}
Set ''objectvariable'' = {''objectexpression'' | ''Nothing''}


== Description ==
== Description ==


Set is used to assign an object reference to a variable. The required component, ''objectvariable'', is a variable that follows standard variable naming conventions. The required component, ''objectexpression'', is the name of an object, a variable containing an object reference, or Function call that returns an object. The optional keyword, NOTHING, removes the association between objectvariable and any given object. When an object has no variables which reference it, the system and memory resources allocated to it are released. Set is equivalent to a normal assignment statement.
Set is used to assign an object reference to a variable. The required component, ''objectvariable'', is a variable that follows standard variable naming conventions. The required component, ''objectexpression'', is the name of an object, a variable containing an object reference, or Function call that returns an object. The optional keyword, ''Nothing'', removes the association between objectvariable and any given object. When an object has no variables which reference it, the system and memory resources allocated to it are released.  
 
Set is the same as a normal assignment statement, so there is no need to use it. It is only exists for backwards compatibility.


== Example ==
== Example ==
Line 11: Line 13:
'Set assigns objects to variables
'Set assigns objects to variables
Dim ButtonRef
Dim ButtonRef
AddObject "Picturebox","Button",0,0,10,10
Set ButtonRef=Button1
Set ButtonRef = Button
Print ButtonRef.id
</pre>
 
== Output ==
 
<pre>
Button1
</pre>
</pre>


== Related Items ==
== Related Items ==


[[is (operator)|IS]]
[[is (operator)|Is]]


[[Category:Language Reference]]
[[Category:Language Reference]]
[[Category:Variable Handling]]

Latest revision as of 14:17, 9 April 2013

Set objectvariable = {objectexpression | Nothing}

Description

Set is used to assign an object reference to a variable. The required component, objectvariable, is a variable that follows standard variable naming conventions. The required component, objectexpression, is the name of an object, a variable containing an object reference, or Function call that returns an object. The optional keyword, Nothing, removes the association between objectvariable and any given object. When an object has no variables which reference it, the system and memory resources allocated to it are released.

Set is the same as a normal assignment statement, so there is no need to use it. It is only exists for backwards compatibility.

Example

Rem Set Example
'Set assigns objects to variables
Dim ButtonRef
Set ButtonRef=Button1
Print ButtonRef.id

Output

Button1

Related Items

Is