Task

Show how to represent the boolean states "true" and "false" in a language.

If other objects represent "true" or "false" in conditionals, note it.



Related tasks

   Logical operations


 
Module CheckBoolean {
      A=True
      Print Type$(A)="Double"
      B=1=1
      Print Type$(B)="Boolean"
      Print A=B  ' true
      Print A, B   ' -1   True
      Def boolean C=True, D=False
      Print C, D , 1>-3 ' True False True
      K$=Str$(C)
      Print K$="True"  ' True
      Function ShowBoolean$(&x) {
           x=false
           Try {
                        if keypress(32) then x=true : exit
                        If Keypress(13) then exit
                        loop
            }
            =str$(x, locale)
      }
      Wait 100
      Print "C (space for true, enter for false)="; : Print ShowBoolean$(&c)
      Print C
}
CheckBoolean
 
Print str$(True, "\t\r\u\e;\t\r\u\e;\f\a\l\s\e")="true"
Print str$(False, "\t\r\u\e;\t\r\u\e;\f\a\l\s\e")="false"
Print str$(2, "\t\r\u\e;\t\r\u\e;\f\a\l\s\e")="true"
 
 