Optional function arguments

Hello,

I have created a function with some input parameters. The last input parameter is optional and should be initialized to -1 by default. When I try to call the function without this optional input parameter, the compiler shows an error that I have too few input parameters for the function.

Is it generally not possible to have optional input parameters in a function or do I have to declare the input parameters as optional. If so, how do I do this?

Unfortunately, I can’t find anything about this in the help.

Hi there,

there is no such thing as an optional parameter to a function, which is why you don’t find anything about it in the help.
You could make the function a function block instead - then you can skip passing any args.

Best regards