How to create a list argument "in-place"

1,166 views
Skip to first unread message

vbs

unread,
Jan 19, 2016, 10:21:14 AM1/19/16
to robotframework-users
Guys, I am sorry, this is probably a basic question but I failed to find an answer:

I know I can create a list variable and pass it as a keyword argument:

@{MYLIST}=    Create List    a    b
MyKeyword      ${MYLIST}

But is there any syntax I can use to create the list "in-place" without having to create a temporary variable to pass over? Something like:
MyKeyword      ${[a,b]}

Thanks in advance!
Robin

Tatu Aalto

unread,
Jan 20, 2016, 8:35:30 AM1/20/16
to robin...@gmail.com, robotframework-users

Ugh

No, it's not possible do it in that way [1]. But if you are looking variable number of arguments, that is possible [2].

[1] http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#user-keyword-arguments
[2] http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#varargs-with-user-keywords

--
You received this message because you are subscribed to the Google Groups "robotframework-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-u...@googlegroups.com.
To post to this group, send email to robotframe...@googlegroups.com.
Visit this group at https://groups.google.com/group/robotframework-users.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages