Hi, how can i check if condition or another condition then do something?
in other words, if one of the 2 conditions is true then do something
thanks!
check if two conditions
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
- Livecode Opensource Backer
- Posts: 10097
- Joined: Fri Feb 19, 2010 10:17 am
Re: check if two conditions
Simple logic:
-
Code: Select all
on mouseUp
if fld "f1" is empty then
-- do nothing
else
add 1 to XXX
end if
if fld "f2" is empty then
-- do nothing
else
add 1 to XXX
end if
if XXX > 0 then
put "Yippee!" into fld "f3"
else
put empty into fld "f3"
end if
end mouseUp
- Attachments
-
- BICONDITIONAL.livecode.zip
- Here's the stack.
- (1.21 KiB) Downloaded 108 times
Re: check if two conditions
Hi Samuele,
you already mentioned it! Use OR!
Best
Klaus
you already mentioned it! Use OR!

Code: Select all
...
if fld "your field" = EMPTY OR some_variable = 42 then
## do something
end if
...
Klaus