IF-function in calculation

I’m trying to have an IF-function in a calculation. (stored)

Something like this:

return
if field1 == 1
{
“Check1”
}
else
{
“Check2”
}
;

But I can’t get it work. Servoy complaines about a validation.
Anyone any idea??

Sorry, found it in the Servoy Quickstart.

the word return has to be placed between the if function. Not in front!

Made the same mistake myself!
I found a few good examples in the CRM.
(Just select DATPROVIDERS in the tools menu and you’ll find them).