Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing documentation for variable2 in <test> and <strcmp> #717

Merged
merged 1 commit into from
Apr 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 13 additions & 9 deletions docs/scenarios/actions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -354,12 +354,14 @@ A string variable and a value can be compared using the <strcmp>
action. The result is a double value, that is less than, equal to, or
greater than zero if the variable is lexographically less than, equal
to, or greater than the value. The parameters are assign_to, variable,
and value. For example::
and value or variable2. For example::

<nop>
<action>
<!-- Compare the value of $strvar to "Hello" and assign it to $result.. -->
<!-- Compare the value of $strvar to "Hello" and assign it to $result. -->
<strcmp assign_to="result" variable="strvar" value="Hello" />
<!-- Compare the value of $strvar to the value of $othervar. -->
<strcmp assign_to="result" variable="strvar" variable2="othervar" />
</action>
</nop>

Expand All @@ -369,17 +371,19 @@ Variable Testing
++++++++++++++++

Variable testing allows you to construct loops and control structures
using call variables. THe test action takes four arguments: variable
which is the variable that to compare against value , and assign_to
which is a boolean call variable that the result of the test is stored
in. Compare may be one of the following tests: equal , not_equal ,
greater_than , less_than , greater_than_equal , or less_than_equal .

Example that sets ``$2`` to true if ``$1`` is less than 10::
using call variables. The test action takes four arguments: variable
which is the variable to compare against, either value or variable2,
assign_to which is a boolean call variable with the result of the
test and compare. Compare may be one of the following tests: equal,
not_equal, greater_than, less_than, greater_than_equal or
less_than_equal. For example::

<nop>
<action>
<!-- Sets ``$2`` to true if ``$1`` is less than 10 -->
<test assign_to="2" variable="1" compare="less_than" value="10" />
<!-- Sets ``mycheck`` to true when strings in ``myvar`` and ``thatvar`` are equal -->
<test assign_to="mycheck" variable="myvar" compare="equal" variable2="thatvar" />
</action>
</nop>

Expand Down