Does QB64pe already have a function like IFF ?
#4
(06-03-2023, 07:43 PM)SMcNeill Wrote: What does an IFF do?

From this Wikipedia article:

Code: (Select All)
IIf(expr, truepart, falsepart)

Although the code-volume-savings is nothing to brag about at all, it is very nice cognitively (semantically?) for assigning values to variables (and maybe some other circumstances I'm not thinking of).

So putting the focus on a variable:

Code: (Select All)
variable = IIF( expr, truevalue, falsevalue )

instead of putting the focus on an IF THEN ELSE statement:

Code: (Select All)
IF expr THEN variable = truevalue ELSE variable = falsevalue
Reply


Messages In This Thread
RE: Does QB64pe already have a function like IFF ? - by CharlieJV - 06-03-2023, 08:08 PM



Users browsing this thread: 6 Guest(s)