[TOC] [Prev] [Next] [Bottom]



<@SETPARAM>

Syntax

<@SETPARAM NAME=name VALUE=value>

Description

<@SETPARAM> sets the value of a parameter variable within a Tango class file. This tag is similar to <@ASSIGN>, but performs error checking to ensure that only Out and In/Out parameters of a Tango class file can be set.

This meta tag is specifically used for setting the value of a parameter in a Tango class file. If the variable specified by the NAME attribute is not a Tango class file In/Out or Out parameter, this tag returns an error.

This tag is only valid within a Tango class file method.

For more details on variables, see Chapter 8 and Chapter 9 of the User's Guide.

The NAME attribute specifies the name of the parameter to assign the value to. Similar restrictions apply to parameter names assigned by <@SETPARAM> as apply to all variables; see <@ASSIGN>.


! Note: Because the parameter variables specified by <@SETPARAM> are only valid in method scope, scope cannot be specified in the NAME attribute, unlike the <@ASSIGN> meta tag (for example, NAME=local$foo generates incorrect results).


The VALUE attribute specifies the value to assign to the variable. The VALUE attribute may specify text, an array (using the <@ARRAY> meta tag or an array variable), a DOM variable, or an object variable.

Arrays

If the parameter being assigned to exists and contains an array, this tag also lets you set the values of individual elements in that array. <@SETPARAM> can assign an array (or array section) to a variable, or to another array (or array section). Array assignments require that the source and target arrays (or array sections) have the same dimensions.

If you are assigning to an array variable element or section, the name includes the element or section specification specified within square brackets as [rownumber,colnumber], with an asterisk indicating all rows or all columns; for example, NAME=myArray[1,2] or NAME=myArray[*,3].

If you are assigning to an array section, the value specified here must match the dimensions of the array variable specification in NAME.

Example

Within the Results HTML of a Tango class file method, you could use the following series of meta tags to get the value of an In parameter (in this case, the radius of a sphere), perform calculations on it (calculating the surface area of a sphere), and set the value of a returned (Out) parameter accurate to two decimal places:

<@SETPARAM NAME=OutSurface VALUE=<@CALC EXPR="4*P*(<@GETPARAM NAME=Radius>^2)" PRECISION=2>>

See Also

<@ASSIGN>
<@GETPARAM>



[TOC] [Prev] [Next] [Bottom]



docs@pervasive.com

Copyright © 1999, Pervasive Software. All rights reserved.