Documentation Comments
Use this form to comment on this topic. You can also provide any general observations about the Online Documentation, or request that additional information be added in a future release.
RealityV15.1Online Documentation (MoTW) Revision 7
%Array Special Method for Connection Objects (databasic_sp_method_array_connection.htm)
This method is used with a connection object to create an array of primitive types on the language server and return a reference to it.
%Array(Type, Initialiser1 {, Initialiser2{, ...}})
%Array(Type, DynamicArray)
Type | Java primitive type (string, int, float, bool, etc.) |
Initialiser1 | A suitable initialiser for Type |
DynamicArray | An attribute mark delimited list |
Var = %Array(int, 1, 2, 3, 4)
Create an array of ints initialised to 1, 2, 3, 4. This is equivalent to the Java syntax:
int[] Var = new int[] { 1, 2, 3, 4 };
The following is the equivalent statement using a dynamic array:
Init = "1^2^3^4" Init = CHANGE(Init, '^', @AM) Var = SecondCon->%Array(int, Init)
Initialise a dynamic array and then use it to create an array of ints initialised to 1, 2, 3, 4 on SecondCon.
Such arrays of primitive objects are often needed as parameters to Java methods, and this is the only way to create a suitable object.