IFF
IFF (condition, return_value_true, return_value_false)
Inline version of IF.
Example 1
"cat"
animal = IFF( animal == "cat", "yes", "no")
fur = print fur
Example 2
"sin"
Eq = 5
x =
iff(Eq == "sin", sin(x), cos(x))
ans = print ans
' Alternative syntax:
if(Eq == "sin") then
sin(x)
ans = else
cos(x)
ans = endif
print ans
Example 3
4
x =
iff(x <= 5, 0, 10)
ans = print ans
Code samples using IFF
003 conditional branching.bas
100lines.bas
2048.bas
2048.bas
3d block lettes.bas
Another center finder.bas
ascii 3d.bas
B+B.bas
Ball.bas
base64.bas
bb2fork smurf.bas
bonkers.bas
checkers.bas
checkers.bas
chess.bas
chess.bas
circ.bas
conrec-sb-v01.bas
crgb.bas
dogstar5.bas
driven_mass_and_spring.bas
falling blocks - tetris.bas
first factors mga.bas
fizzle2.bas
func.bas
g_col_09.bas
galgenmann.bas
gobble_solver.bas
image demo.bas
Language
AND
AS
BAND
BG
BOR
BYREF
CALL
CASE
CATCH
CONST
DECLARE
DEF
DO
ELIF
ELSE
ELSEIF
END
END TRY
ENDIF
EQV
EXIT
FALSE
FI
FOR
FUNC
GOSUB
GOTO
IF
IFF
IMP
IN
LABEL
LET
LIKE
LOCAL
LSHIFT
MDL
MOD
NAND
NEXT
NOR
NOT
ON
OR
REM
REPEAT
RETURN
RSHIFT
SELECT
STEP
STOP
SUB
THEN
THROW
TO
TRUE
TRY
UNTIL
USE
USG
USING
WEND
WHILE
XNOR
XOR
If there is insufficient information on this page and you wish learn more about IFF,
please send an email to smallbasic@gmail.com. You can help to improve information about
IFF by submitting a pull request,
click View Source for details. Note, an offline language reference text file is also available - see the Download section.