IF-function in calculation

Questions, tips and tricks and techniques for scripting in Servoy

IF-function in calculation

Postby Harjo » Tue Jun 10, 2003 10:44 am

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??
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Postby Harjo » Tue Jun 10, 2003 10:56 am

Sorry, found it in the Servoy Quickstart.

the word return has to be placed between the if function. Not in front!
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Postby Ron » Tue Jun 10, 2003 12:13 pm

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).
Ron
 
Posts: 315
Joined: Fri May 23, 2003 12:30 am
Location: Netherlands


Return to Methods

Who is online

Users browsing this forum: No registered users and 6 guests

cron