Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This page provides guidance for some of the basic principles and practices of writing calculations or logic in CommCare

Single vs Double Quotations

Generally XPath expressions values in display or calculation conditions will be surrounded by inside quotes IE
<bind nodeset="/data/name" />
However literal values would also be surrounded by single quotes:
<bind nodeset="/data/name" calculate="'will pride'" />

...

 

You can use single quotes or double quotes, both work fine.

Spaces

Spaces generally will not matter (i.e. Will be ignored) unless they are themselves in a string literalinside quotes.