Array in libreoffice macro

Hello!

I would like to define (in ooo macro)
an integer array
from 0 to N with “pitch” egual to 10;

For example:
[0 10 20 30 … N]

Could I automate this?
Becouse the extrem term N is not costant,
it can be change.

Thanks in advance

Fede

LO 5.2 SO Windows 10

Do you mean something like this?

Function getNewArray(N As Integer) As Variant
Dim i As Integer
Dim aResult(1 To 1) As Integer
	aResult(1) = 0
	If N > 0 Then 
		ReDim aResult(1 To N)
		For i = 1 To N
			aResult(i) = (i-1)*10
		Next i
	EndIf
	getNewArray = aResult
End Function

Call it as

myArray = getNewArray(5)

Yes :smiley: Thanks