Function that returns an array values

Hello!
I would like to writer in Calc (macro)
a function, which result is an array of values

function array(input data)

instructions

array(1) = …
array(2) = …
array(3) = …

end function

Is it possible, in your opinion? :slight_smile:

Thank you

Best Regards

SO Windows 7 - Windows 10
SW Libreoffice 5.2.3

Hi

It is possible…

screenshot

Confirm entry using the key combination Ctrl+Shift+Enter

[EDIT]

You can call the function from another procedure, eg.:

Sub Main

dim lMyValues(1) as long, lOneValue as long

lMyValues = MyArray(2310)

for each lOneValue in lMyValues
	print lOneValue 
next lOneValue 

End Sub

function MyArray(lValue as long)
MyArray = array(lValue * 2, lValue * 3)
end function

Regards

Well Done Thank you Pierre :slight_smile:
If I want To pass this values to another function in StarBasic,
it is Always possible?

See my edit in my answer…