Hi,
How can I create a varidic function which accept variable number of inputs? (just like the built-in print function does)
I searched in the wiki but no luck... thanks
Variadic function
- TJ
- Posts: 7740
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2221 times
Re: Variadic function
I am not too sure what you mean by "Print Function".
What EXACTLY do you want to do?
What EXACTLY do you want to do?
- JoshM
- Posts: 2195
- Joined: 20 May 2011
- Location: The Netherlands
- Has thanked: 1544 times
- Been thanked: 1565 times
- Contact:
Re: Variadic function
As far as I know it's not possible in MultiCharts PowerLanguage to make a function that accepts an arbitrary number of argument values.
What you can do as a workaround is to give the function an array input, and then inside the function loop through the array and collect the argument values that way.
What you can do as a workaround is to give the function an array input, and then inside the function loop through the array and collect the argument values that way.
Re: Variadic function
@TJ, I want to create function with arbitrary number of arguments, is it possible in PowerLanguage?
If not, maybe I can work-around with array as @JoshM suggests.
thanks for the reply
If not, maybe I can work-around with array as @JoshM suggests.
thanks for the reply
- Tammy MultiCharts
- Posts: 200
- Joined: 06 Aug 2020
- Has thanked: 6 times
- Been thanked: 65 times
Re: Variadic function
Hello hoishing,@TJ, I want to create function with arbitrary number of arguments, is it possible in PowerLanguage?
If not, maybe I can work-around with array as @JoshM suggests.
thanks for the reply
Please use the solution suggested by JoshM: accessing the argument values through an array input.