Revision: 3597
Author: pekka.klarck
Date: Thu May 27 12:59:55 2010
Log: explain new limitations with list variables and settings (issue 564)
http://code.google.com/p/robotframework/source/detail?r=3597
Modified:
/trunk/doc/userguide/src/CreatingTestData/Variables.txt
=======================================
--- /trunk/doc/userguide/src/CreatingTestData/Variables.txt Wed May 26
07:42:25 2010
+++ /trunk/doc/userguide/src/CreatingTestData/Variables.txt Thu May 27
12:59:55 2010
@@ -51,7 +51,6 @@
- When values in the test data are long or otherwise complicated. For
example, :var:`${URL}` is shorter than
:code:`\http://long.domain.name:8080/path/to/service?foo=1&bar=2&zap=42`.
-
If a nonexistent variable is used in the test data, the keyword using
it fails. If the same syntax that is used for variables is needed as a
@@ -63,7 +62,6 @@
__ `Setting variables in command line`_
__ Escaping_
-
Variable types
~~~~~~~~~~~~~~
@@ -87,7 +85,6 @@
numbers, underscore and space is recommended, and it is
even a requirement for using the `extended variable syntax`_.
-
Scalar variables
''''''''''''''''
@@ -170,7 +167,7 @@
if you try to use byte sequences as arguments to keywords so that
you catenate the values together like :code:`${byte1}${byte2}`.
A workaround is creating a variable that contains the whole value
- and using it alone in the cell (e.g. :code:`${bytes}`) as then
+ and using it alone in the cell (e.g. :code:`${bytes}`) because
then
the value is used as-is.
List variables
@@ -205,6 +202,9 @@
List Variable Login @{USER} \
============= ======== =========== ==========
+Accessing individual list variable items
+````````````````````````````````````````
+
It is also possible to access a certain value from the list variable
with the syntax :var:`...@{name}[i]`, where :var:`i` is the index of the
selected value. Indexes start from zero, and trying to access a value
@@ -249,11 +249,33 @@
\ Log Many @{items} \ \
============= ================ ============== ========== ==========
-Where list variables can be used
-````````````````````````````````
-
-TODO
-
+Using list variables with settings
+``````````````````````````````````
+
+List variables can be used only with some of the settings__. They can
+be used in arguments to imported libraries and variable files, but
+library and variable file names themselves cannot be list
+variables. They work exactly the same way also with setups and
+teardowns, and with tag related settings they can be used
+freely. Using scalar variables is possible also in those places where
+list variables are not supported.
+
+.. table:: Using list variables with settings
+ :class: example
+
+ ============== =============== =============== ====================
+ Settings Value Value Comment
+ ============== =============== =============== ====================
+ Library ExampleLibrary @{LIB ARGS} # This works
+ Library ${LIBRARY} @{LIB ARGS} # This works
+ Library @{KEYWORD} # This does not work
+ Suite Setup Some Keyword @{KW ARGS} # This works
+ Suite Setup ${KEYWORD} @{KW ARGS} # This works
+ Suite Setup @{KEYWORD} # This does not work
+ Default Tags @{TAGS} # This works
+ ============== =============== =============== ====================
+
+__ `All available settings in test data`_
Environment variables
'''''''''''''''''''''
@@ -351,8 +373,8 @@
Variable Value Value Value
============ ========= ========= =========
@{NAMES} Matti Teppo \
- @{EMPTY} \ \ \
- @{NAMES2} @{NAMES} @{EMPTY} Seppo
+ @{NAMES2} @{NAMES} Seppo \
+ @{NOTHING} \ \ \
@{MANY} one two three
... four five six
... seven \ \