or function

Questions, tips and tricks and techniques for scripting in Servoy

or function

Postby Harjo » Tue May 27, 2003 8:19 am

Can I use an or function in an if statement?

Something like this:
if(globals.gebruikersnaam == "" or globals.wachtwoord == "")

I have tried this but it won't work.
Any suggestions?
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Postby Jan Aleman » Tue May 27, 2003 9:27 am

In JavaScript (and many other programming languages) an OR is written as: || (two pipe's)

if(globals.gebruikersnaam == "" || globals.wachtwoord == "")

&& is the symbol for a logical AND
and ! is used for NOT
Jan Aleman
Servoy
Jan Aleman
 
Posts: 2083
Joined: Wed Apr 23, 2003 9:49 pm
Location: Planet Earth


Return to Methods

Who is online

Users browsing this forum: No registered users and 6 guests