- In the VBE Immediate Window:
- In the VBE Immediate Window:
February 11, 2025
Reported content has been submitted
I cannot replicate the issue (as I cannot get the last Docvariable Var1 field to display anything when I toggle it.
However, if I change the last construction to
{IF {COMPARE {DOCVARIABLE bVar1} = "true"} = 0 {DOCVARIABLE Var1} {IF {DOCVARIABLE Var1} = "rabbit" "giraffe"} }
it shows giraffe, indicating that the last docvariable var1 field is returning rabbit.
Reported content has been submitted
Was this reply helpful?
Sorry this didn't help.
Great! Thanks for your feedback.
How satisfied are you with this reply?
Thanks for your feedback, it helps us improve the site.
How satisfied are you with this reply?
Thanks for your feedback.
I don't see the failure of the nested DOCVARIABLE field to update. What I do see that's a bit unexpected is that when bVal1 = "true", the {DOCVARIABLE Var1} field just before the = "giraffe" appears to have an empty string as its value.
However, the preceding one contains the correct current value of Var1.
When I change bVar1 to "false", both of those {DOCVARIABLE Var1} fields have the correct value.
Either way, the displayed result of the outer IF field is correct.
I think what we're seeing is the result of something called "short-circuit evaluation": When the result of the IF statement's comparison is True, then the False clause is not evaluated at all. When the comparison is False, the True clause may or may not be
evaluated. This optimization saves time and CPU cycles.
Reported content has been submitted
Was this reply helpful?
Sorry this didn't help.
Great! Thanks for your feedback.
How satisfied are you with this reply?
Thanks for your feedback, it helps us improve the site.
How satisfied are you with this reply?
Thanks for your feedback.
Reported content has been submitted
Was this reply helpful?
Sorry this didn't help.
Great! Thanks for your feedback.
How satisfied are you with this reply?
Thanks for your feedback, it helps us improve the site.
How satisfied are you with this reply?
Thanks for your feedback.
Reported content has been submitted
Was this reply helpful?
Sorry this didn't help.
Great! Thanks for your feedback.
How satisfied are you with this reply?
Thanks for your feedback, it helps us improve the site.
How satisfied are you with this reply?
Thanks for your feedback.
I replaced the 1 by 0
If the condition in the outer If field is false, then the final docvariable field is evaluated as it is part of the false result for the outer If field.
Reported content has been submitted
Was this reply helpful?
Sorry this didn't help.
Great! Thanks for your feedback.
How satisfied are you with this reply?
Thanks for your feedback, it helps us improve the site.
How satisfied are you with this reply?
Thanks for your feedback.
Reported content has been submitted
Was this reply helpful?
Sorry this didn't help.
Great! Thanks for your feedback.
How satisfied are you with this reply?
Thanks for your feedback, it helps us improve the site.
How satisfied are you with this reply?
Thanks for your feedback.