Default value for the embedded arguments?

HI, Is it possible to set default value for a keyword embedded arguments?
Seems like there is no such feature but just in case I can’t find this for some reason.
Thanks!

Hi,

I don’t know, but I doubt this is possible. That would break the syntax. If you leave out the embedded argument you would most like have 2 spaces in your keyword call which would result in a token separation.

Regards,
Markus

2 Likes

I agree with Noordsestern, this is not natively supported.

Embedded arguments do not support default values or variable number of arguments like normal arguments do. If such functionality is needed, normal arguments should be used instead.

However, it is possible using the following trick: do not put space between the argument and the previous or following word. This way you avoid having two consecutive spaces when calling the keyword without value. You are actually calling it with the “empty string” value.
You also have to “implement” the default value using a condtional statement.

Check this out.

Note that you end up with a leading or trailing white space, so you might want to trim it with Strip String.

3 Likes

Thank You!