A89: Re: True/False -> 1/0???


[Prev][Next][Index][Thread]

A89: Re: True/False -> 1/0???




Hi!

| Is there an efficient and fast way to interpret "True"s and "False"s to be
| 1's and 0's, respecively?  On the TI-85, "True" and "False" were
| automatically interpreted as simply "non-zero" and "zero", and that was
| pretty handy a lot of times...

I think that this belongs to the BASIC list.  Anyway, you can write a simple
function to do this; something like

booltint(bv)
Func
 If bv
  Return 1
 0
EndFunc

You might also be able to do this with the "when" function, e.g.

booltint(bv)
when(bv,1,0)

But if bv doesn't simplify to true or false, this won't through an error,
but rather give you a when statement as the result.

Bye,
Sebastian Reichelt




References: