Arezzo is not a case-sensitive language. You can type Arezzo keywords and functions in either upper or lower case, or a mixture of upper and lower case. Similarly, identifiers for questions, eForms and visits may be in either upper or lower case.
The comparison of text strings is not case-sensitive unless you use the == operator.
For example, if the question SubjName has the value 'John Green', then the following conditions will be true or false as shown.
Condition |
Result |
SubjName = ’john green’ |
True |
SubjName == ’john green’ |
False |
SubjName == ’John Green’ |
True |
substring(SubjName,1,4) = ’john’ |
True |
substring(SubjName,1,4) == ’john’ |
False |
substring(SubjName,1,4) == ’John’ |
True |
Arezzo text string in Arezzo should be enclosed in single quotes.
'This is a text string'
There is a limit of 255 characters in a quoted text string.
If you wish to include a single quote within a text string, type the single quote twice. For example:
'St. Paul''s Hospital'
'Today''s date'
If you do not enclose text in single quotes, Arezzo assumes it represents the name of a question, and will try to find the value of that question (if any). The text value will be used if no question can be found with that name. To avoid ambiguity, we recommend that you use always single quotes for text. You have to use single quotes if the text contains spaces, or if it contains other characters that are not allowed in question names.
For example, if there is a question called Continuing, the condition
me:value = Continuing
will compare the current question with the value of the question Continuing.
However, the condition
me:value = 'Continuing'
will always compare with the text string 'Continuing'.
Although you will find that many expressions work correctly without using single quotes around text, the Check button in the Expression Editor will report text without quotes as an "unrecognised name".
Quoting the text avoids this warning.
When you use symbolic operators such as =, >, < etc., we recommend putting spaces around them. Sometimes you do not need the spaces, but in general it is safer to put them in, and can avoid syntax errors. You always need a space between an operator and a quoted text string.
Correct Syntax |
Incorrect Syntax |
person:trialsite = 'mexico' |
person:trialsite='mexico' |
me:value <> 'Y' |
me:value<>'Y' |
If a function needs arguments in brackets, do not put a space between the function name and the left opening bracket.
Correct Syntax |
Incorrect Syntax |
len( SubjName ) |
len ( SubjName ) |
average( BPSystolic ) |
average ( BPSystolic ) |
question( previous ) > me:value |
question ( previous ) > me:value |
if( question:cycle = 1, 'First', 'Second' ) |
if ( question:cycle = 1, 'First', 'Second' ) |
You can put spaces after the left bracket, and before the right bracket, and in between other terms.
If you use more than one operator or function in an expression, it is often necessary to enclose the separate parts of an expression in brackets to avoid ambiguity. Usually it doesn’t matter if you put too many brackets in.
Correct Syntax |
Incorrect Syntax |
SubjectID like (SubjInitials & '%') |
SubjectID like SubjInitials & '%' |
if((me:value = 1 or me:value = 2), 'Low', 'High' ) |
if( me:value = 1 or me:value = 2, 'Low', 'High' ) |
Arezzo expressions must always use a dot for the decimal separator, regardless of the local machine setting.
Related Topics