GetRef: Difference between revisions

From NSB App Studio
Jump to navigation Jump to search
(Created page with "GETREF (''objectName'') '''Description''' GetRef returns a reference to an object. This can be useful when you want get the reference to a function insteal of calling it. '...")
 
 
(7 intermediate revisions by 4 users not shown)
Line 1: Line 1:
GETREF (''objectName'')
''This function is for BASIC compatibility. It is not available in pure JavaScript projects.''  


'''Description'''
GetRef (''objectName'')


GetRef returns a reference to an object. This can be useful when you want get the reference to a function insteal of calling it.
== Description ==


'''Example'''
GetRef returns a reference to an object. This can be useful when you want get the reference to a function instead of calling it.
 
== Example ==


<pre>
<pre>
Line 12: Line 14:
End Function
End Function
   
   
A=printTxt("Call function directly")
A = printTxt("Call function directly")
B=GetRef(printTxt)
B = GetRef(printTxt)
B("Call function indirectly")
B("Call function indirectly")
</pre>
</pre>


'''Output'''
== Output ==


<pre>
<pre>
Line 24: Line 26:
</pre>
</pre>


'''Related Items'''
== Related Items ==
 
[[form|Form]]
 
[[Category:Language Reference]]
 
[[Category:Variable Handling]]


[[form|FORM]]
[[Category:BASIC Functions]]

Latest revision as of 15:25, 25 March 2019

This function is for BASIC compatibility. It is not available in pure JavaScript projects.

GetRef (objectName)

Description

GetRef returns a reference to an object. This can be useful when you want get the reference to a function instead of calling it.

Example

Function printTxt(txt)
  Print txt
End Function
 
A = printTxt("Call function directly")
B = GetRef(printTxt)
B("Call function indirectly")

Output

Call function directly.
Call function indirectly.

Related Items

Form