Difference between revisions of "SET UDFPARMS"
From Recital Documentation Wiki
Yvonnemilne (Talk | contribs) |
Helengeorge (Talk | contribs) |
||
(7 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
==Purpose== | ==Purpose== | ||
Specify whether parameters are passed to a user-defined function by value or by reference | Specify whether parameters are passed to a user-defined function by value or by reference | ||
Line 15: | Line 8: | ||
==See Also== | ==See Also== | ||
− | DO, FUNCTION, | + | [[DO]], [[FUNCTION]], [[PARAMETERS]], [[SET PROCEDURE]] |
Line 23: | Line 16: | ||
==Example== | ==Example== | ||
− | < | + | <code lang="recital"> |
set udfparms to value | set udfparms to value | ||
count = 10 | count = 10 | ||
Line 29: | Line 22: | ||
changecount(count) | changecount(count) | ||
? count | ? count | ||
− | + | 10 | |
set udfparms to reference | set udfparms to reference | ||
count = 10 | count = 10 | ||
Line 35: | Line 28: | ||
changecount(count) | changecount(count) | ||
? count | ? count | ||
− | + | 30 | |
− | + | </code> | |
==Products== | ==Products== | ||
− | Recital | + | Recital Server, Recital |
+ | [[Category:Documentation]] | ||
+ | [[Category:Commands]] | ||
+ | [[Category:Set_Commands|UDFPARMS]] | ||
+ | [[Category:Environment]] | ||
+ | [[Category:Environment Set Commands]] | ||
+ | [[Category:Applications]] | ||
+ | [[Category:Applications Set Commands]] |
Latest revision as of 15:50, 25 November 2009
Purpose
Specify whether parameters are passed to a user-defined function by value or by reference
Syntax
SET UDFPARMS TO VALUE | REFERENCE
See Also
DO, FUNCTION, PARAMETERS, SET PROCEDURE
Description
By default, parameters are passed to UDFs by value. By setting UDFPARMS to REFERENCE, parameters will be passed to the UDF by reference. Variables that are passed by reference can have their values changed in the UDF, and the new values will be available at the scope where the variables were defined.
Example
set udfparms to value count = 10 // Call a UDF that changes the value of count to 30 changecount(count) ? count 10 set udfparms to reference count = 10 // Call a UDF that changes the value of count to 30 changecount(count) ? count 30
Products
Recital Server, Recital