Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Is there a form of BOOL for FreeBASIC or will there ever be
#11
C uses 1 and 0 because it has true boolean operators || && ! , working on a single bit. FB must use 0 and -1 because its operators are biwise, so thjey work on every bit of the variable. If you want NOT FALSE to be TRUE, and 0 is FALSE, then TRUE must be -1.

C++ (and C 99) has true boolean operators, this means you must always use TRUE and FALSE, and not worry about the underlying implementation. The compiler does the translations for you.

Implementing boolean variables in FB would mean to create too the boolean operators, different from the existant bitwise operators: perhaps BAND, BOR BNOT? Let's leave as it is now....
Antoni
Reply
#12
Couldn't agree more...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)