If there is a variable ${var} I want to set its value to 0 if its current value is None otherwise leave the current value unchanged.
I understand it should be very easy but some how I am having trouble in verifying the recipe.
2 Answers
You can use Set variable if, and give the current value as the second value:
${var}= Set variable if $var is None 0 ${var}
Comments
You can use the keyword Set Variable If
${Var}= Set Variable If '${Current_Value}'=='None' 0 ${Current_Value}
1 Comment
Bryan Oakley
This does the same thing whether the current value is the string
"None" or the value is the python value None. I think the OP only wants to set the variable if the current value is the python value None.