When an object is called from another object with parameters, it must have declared the list of parameters it receives. The Parm rule allows to define this declaration.
The set of parameters received in the object, must be declared inside the Parm rule, respecting the order and the data type as they were sent, each one separated by a comma.
Besides, it is optional to point out for each parameter, how it is going to be used (in, out, inout).
If the object was invoked with Call, and N parameters were transferred, the N parameters must be declared in the parm rule. However, if the object was invoked with Udp, (unless in the particular case of invoking a Data Provider):
- N + 1 parameters must be declared in the parm rule of the called object.
- The last parameter declared in the parm rule corresponds to the value which is returned (in other words, corresponds to the value received in the caller object).
- In somewhere of the called object, a value must be assigned to the returned (the last) parameter.
- Every object which has a Parm rule defined, isn't included in the Developer Menu (because if it receives parameters, it must be called with the parameters values).
- Parameters do not receive the null value. If a null value is sent in a parameter, the called program receives an empty value.
Parm([in:|out:|inout:] parm1, [in:|out:|inout:] parm2, [in:|out:|inout:] parm3,…);
in: | out: | inout:
Are operators which allow to define for each parameter, how it is going to be used in the called object (in, out, inout).
parm1, parm2, parm3, ... :
Are variables -defined in the called object- or attributes. We can decide for each parameter received, whether we declare an attribute or a variable, regardless of how it was sent.
What is the difference between using a variable or an attribute in the parm rule of the invoked object ?
If we receive the value in a variable, it may be used freely in programming; as a filter condition for equality, greater than, greater than or equal to, lesser than, lesser than or equal to, it may be used for some arithmetical operation, or whatever we may need to do with it. On the other hand, if we receive the value in an attribute, it will automatically act as filter for equality in the object.
If our objective is not to use a value received to filter for equality, then the only solution possible is to receive the values in variables to use them freely.
The following codes, show two ways of filtering for equality the same information. The result and performance of both solutions are equal.
1) Let's suppose we define a Web Panel for the user to enter a start and end range of names of attractions to be listed.
As the image shows, we inserted two variables in the Web Panel form and a button (we left the default Caption -Confirm- and the default event -Enter- for the button). In the Enter event associated with the button, we will call the procedure that prints the attractions that their names are included in the range indicated by the user.
The procedure will receive the start and end range of names of attractions, and we will use the range received to filter the requested attractions.
This is the invocation defined in the web panel:
And this is the parm rule declared in the procedure:
Note that we have named the variables differently regarding the names defined in the web panel. What is important is that the data types sent and received match.
The variables we receive in the procedure will be used to filter the requested attractions. The following image shows the procedure source section, with the code that solves the requirement, using the received variables to filter:
Note: Suppose that this procedure has the properties and rule necessary to print the output in a PDF format.
2) See the proposed examples in the following articles:
Related specification messages
- spc0068 when a parameter has a data type that cannot be used for parameters in certain circunstances.
- spc0023 for each parameter in the call command having a data type that is not compatible with the correspondig in the parm rule
- spc0024 if there are too few parameters in the call command
- spc0025 if there are too many parameters in the call command