CALL Verb - BBj
For this topic's original documentation, see the CALL Verb.
BBj-Specific Information
Syntax
CALL fileid{::label}{,ERR=lineref}{,expr...}
Description
In BBj, expr… can include object variables, object arrays and object expressions.
A simple object variable, like X!, must be passed to a simple object variable in the ENTER list.
A BBj object array created with the DIM Verb must be passed to an object array reference in the ENTER list.
A Java array created with the new operator must be passed to a simple object variable in the ENTER list.
An object expression can be passed to any variable type for which assignment is valid.
The original BBx CALL Verb documentation says, "The same call-by-reference argument can only appear once in the argument list." Prior to BBj 16, BBj inadvertently did not enforce this rule. This oversight was corrected in BBj 16, but some applications may include code that violates this rule. If updating the application is impractical, the ALLOW_DUPLICATE_CALL_VARS !COMPAT setting can be set to TRUE in BBj 17 and higher to allow the original more lenient BBj behavior.
See ENTER for additional information.
Example 1
An object variable must be passed to an object variable:
CALL "subprog",X! |
Example 2
A BBj object array must be passed to an object array:
DIM X![10] |
Example 3
Any expression involving objects can be passed to any variable type for which a corresponding assignment would be legal:
X!=23 |
Example 4
An object expression that does not evaluate to a number or string must be passed to an object variable.
CALL "subprog",new java.lang.ArrayList() |
Example 5
A Java array created with the new operator must be passed to a simple object variable (array!, not array![]).
restore 0 |