Does QB64pe already have a function like IFF ?
#11
(06-05-2023, 04:26 PM)bplus Wrote: Hi Charlie what does BAM do here?
Code: (Select All)
Boolean = (7 < 8) ' this is a boolean expression NOT a string! that evaluates to 1 or -1
Print Boolean

Boolean = (7 > 8) '  this is a boolean expression NOT a string! that evaluates to 0
Print Boolean
I ask because IFF typically takes a numeric expression that evaluates to "True" or "False" numerically -1 or 1 and 0 for false.

mnrvovrfc had it setup correctly, I don't see where you are inferring a string expression for the first parameter.

The first expression in IFF can be anything that results in either TRUE (i.e. anything other than zero) or FALSE (i.e. zero).

The second expression IFF will be the return value when the first expression yields "TRUE" (i.e. non-zero).  The second expression can be anything at all that results in either a number or a string.

The third expression in IFF will be the return value when "FALSE" (i.e. zero).  The third expression can be anything at all that results in either a number or a string.



   
Reply


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



Users browsing this thread: 1 Guest(s)