When arrayappend is used in Lotus script, the syntax is roughly as follows:
Array1 = arrayappend (array1, array2)
As the name implies, array2 is merged into array1. According to help, array2 is not necessarily a series, but array1 must be a series!
This requirement is annoying, because it means that when we create an array from 0, we cannot use arrayappend, which is very useful. Instead, we need to endlessly redim The for loop.
That is to say, the following seemingly reasonable statement will be prompted as not compliant with the syntax.
V = 1
V = arrayappend (v, 2)
But we know that if V is a series, there will be no such problem. If you don't want redim, the following tips will be very useful.
V = Split (1)
V = arrayappend (v, 2)
Split will force us to create a series, and there is only one value in this series, that is, 1. This will not destroy the value of V, but also solve the syntax problem.
A practical application is:
Dim I as integer, numberlist as variantnumberlist = Split (1) for I = 2 to 20 numberlist = arrayappend (numberlist, I) nextprint join (numberlist, ",") 'prints 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20